drupal-theming

How Load a Theme For Path

痴心易碎 提交于 2019-12-11 08:34:37
问题 I like Context if Path /gallery Load A New Theme example "Bartik" Other page load "Omega" Theme I'm Install "Context Condition Theme" Modules But it does not working What's your recommendation ? 回答1: Use can use ThemeKey module. Enable ThemeKey module and its required sub modules, then go to the config page at admin/config/user-interface/themekey . Here you will see may options for switching the theme. As you required there is an option path:node_alias so select this option and also set the

Drupal 8 include part template

谁说胖子不能爱 提交于 2019-12-10 17:21:38
问题 I'm trying to use Drupal 8, with an own theme, due big structure differences for my requirements I have a page--front.twig.html and a page.twig.html, I would like to create template parts as used in phrozn oder in a normal Symfony2 project, for example a footer.html.twig and a header.html.twig. These templates are saved under a subdirectory /parts/ But wenn I call this templates as normal I just receive a string with the name of the template. For example: {# in page.html.twig or page--front

Programmatic Views in Drupal 7

北城以北 提交于 2019-12-10 11:54:43
问题 I'm trying to create two views. View-1 is a list of nodes. View-2 is an image gallery associated with each node. I basically want to pass the node title from View-1 to a programmatic View-2, so that each row in View-1 will load View-2(with a result set filtered by the title of View-1!). I'm confused about the approach. Should this happen in a custom module, preprocess functions, or some combination thereof? I run into this a lot - wanting to pass an argument from a primary view to a secondary

Create a custom template file for a custom block in drupal

半腔热情 提交于 2019-12-10 10:25:09
问题 What is the drupal way to create a custom .tpl file for theming a custom block? Specifically I m trying to create a block programmatically and then find a way to separate the view code from the module php code. If it was a page the Drupal theme() would be very efficient way to achieve this. However I can't find what is the Drupal way to do the same thing for custom blocks. I 've tried to use the hook_theme() with no luck. //implementation of hook_block_info function mymodule_block_info() {

Prev/Next node navigation with a thumbnail in a full node

醉酒当歌 提交于 2019-12-09 03:23:54
问题 I've been trying to figure this out and make it work, but as I'm not a programmer, just a designer with limited coding knowledge I've been hitting a wall on this one. I'm making my own photo gallery and I would like to display two previous or next images as linked thumbnails. I've found this script that works and shows textual links, but don't know how to adapt it to my needs. template.php <?php function dad_prev_next($current_node = NULL, $op = 'p') { if ($op == 'p') { $sql_op = '<'; $order

Drupal 7 hook_theme() not loading template file

丶灬走出姿态 提交于 2019-12-07 13:08:55
问题 I'm trying to get a very simple module to load a template file using drupal's hook_theme(). It's pretty much as simple as you can possibly imagine. function sectionheader_theme ( $existing, $type, $theme, $path ) { return array( 'sectionheader' => array( 'variables' => array( 'foo' => NULL ), 'template' => 'sectionheader', ), ); } The template is named sectionheader.tpl.php. The rest of the module is working as expected. I've cleared the Drupal cache. I've inserted a die("Debug") statement in

Drupal login form customize

你说的曾经没有我的故事 提交于 2019-12-06 12:19:04
问题 Hi i have used this code <?php $elements = drupal_get_form("user_login"); $form = drupal_render($elements); echo $form; ?> to get the default Drupal login form for my site but I need to customize the HTML, I have found some pages in module/users but did not understand how to customize the structure. 回答1: use this in template.php function themename_theme() { $items = array(); $items['user_login'] = array( 'render element' => 'form', 'path' => drupal_get_path('theme', 'corporateclean') . '

Remove stylesheet selectively in Drupal for page

人盡茶涼 提交于 2019-12-06 04:38:53
问题 I am trying to make different layout for the front page. In that process I declared new stylesheet called "front-page.css" and page--front.tpl.php. I am using a Zen subtheme which loads responsive-sidebar.css. I want to remove "responsive-sidebar.css" and load "front-page.css". The reason I am doing it because the number of grind columns in the later stylesheet is different that former. I don't want to use Panels module. I am using Drupal 7. 回答1: The Drupal 7 way is to use hook_css_alter():

Drupal login form customize

好久不见. 提交于 2019-12-04 19:35:35
Hi i have used this code <?php $elements = drupal_get_form("user_login"); $form = drupal_render($elements); echo $form; ?> to get the default Drupal login form for my site but I need to customize the HTML, I have found some pages in module/users but did not understand how to customize the structure. use this in template.php function themename_theme() { $items = array(); $items['user_login'] = array( 'render element' => 'form', 'path' => drupal_get_path('theme', 'corporateclean') . '/templates', 'template' => 'user-login', ); and create a template folder and within that create a file user-login

How to theme a menu block in Drupal?

喜欢而已 提交于 2019-12-04 19:25:20
This should really be a basic question but I simply don't get it after hours of searching. The question is, how do I theme menu blocks in Drupal 7? I've created three different blocks all based on the main menu. Now I want to: create unique HTML for all three blocks, that means modifing the surrounding wrapper and the <ul> and <li> that builds the menu. I wanna set special classes and remove all of the Drupal-added stuff attach different classes to the different levels within each block. One of blocks will show two levels of the menu, i.e. it will display a submenu. I want to set a special