Theme templates are part of Drupal's theming system and allow for the customization of Drupal sites.

learn more… | top users | synonyms (3)

2
votes
1answer
34 views

How can I replace a node reference field with a node edit form?

I have two content types - parent and child. There is a one to many relationship (many children to one parent). I am migrating this content, and the current situation is that that node reference field ...
0
votes
0answers
8 views

Output menu using dpm() and zone template

I am using dpm($variables) to output the array elements for the zone menu. How do I use what is provided to output the zone menu in my template file?
1
vote
2answers
19 views

Removing potentially malicious code from template

Our drupal site was hacked at some point recently, and I've been tasked to clean it up because nobody knows much about drupal here. I think I've taken care of most of the glaring security holes, and ...
0
votes
1answer
14 views

print out multiple values of a taxonomy field

In a taxonomy I have some fields for the terms. To print out 1 of these fields in a node.tpl I found this code: <?php ...
0
votes
3answers
35 views

How to store css & js in separate file & call in custom 'tpl' files through variable in drupal 7?

I have created a custom module where I have define my page url's & contents are created through my custom tpl files. I am applying some css & js on those custom contents/pages/tpl files. ...
0
votes
1answer
23 views

How do I hide the page title based on node type using template_preprocess_page()?

In Drupal 7, this was possible. (See How to hide page title based on node type using template_preprocess_page().) function MYTHEME_preprocess_page(&$variables) { if (!empty($variables['node']) ...
1
vote
1answer
18 views

Tpl for page having url like product/checkout/%/%

I have created a page with hook menu with url product/checkout/%/% where % will be userid and product id. How can I add a page tpl for this url ?
0
votes
1answer
15 views

Is it possible to add a wildcard in template.php to apply function to multiple items

I have a webform with 20 different select options under different fieldsets and they all need to have a custom drop down select field title. To achieve that you use this: function ...
0
votes
0answers
6 views

How to display date in Calendar's week view?

I'm using the Calendar module. In the week display (not minicalendar), I would like to display the date ("January 21, 2015") in the heading in addition to the weekday ("Wednesday"), with the current ...
0
votes
2answers
32 views

Define variables for specific template

I would like to pass variables to a single specific template file(tpl.php). My setting is the following: my_entities.module function my_entities_theme($existing, $type, $theme, $path) { return ...
0
votes
0answers
13 views

How to get submitted form value inside hook_preprocess_hook() in Drupal 7?

I have a management module which consist of two theme pages[much like the core Search module], management-block-form.tpl.php: for showing the form and management-table.tpl.php: for showing the ...
0
votes
1answer
25 views

Add class to a views field depending on image's being vertical or horizontal

I have a view that outputs an image field. I would like to add a class to the .views-field div (for example, actually a views-row would also do the job) depending on whether the image is vertical ...
0
votes
1answer
17 views

How to create a custom frontpage using page--front.tpl.php and keep theme responsiveness

I want my frontpage to be displayed with a full width image, some H2 header text and a navigation menu. However using a page--front.tpl.php and applying custom css i am losing the natural ...
0
votes
0answers
35 views

How to access the unique id from one tpl file to another file in drupal 7?

I have created a custom CRM module & links are defined inside my module file. I have a template file named shop_accessories.tpl.php where all products are shown with some information like Product ...
1
vote
4answers
79 views

How can I print messages in a Panel layout template?

Printing the drupal messages in page.tpl.php is easy: <?php print render($messages); ?> How can I go about doing a similar thing in my Panel layouts? Notes: I realise there is 'status ...
0
votes
2answers
25 views

Theme Templates

I don't have extensive knowledge of Drupal so I'm hoping I can get this question answered. Is it possible to coerce Drupal into loading a template based on a portion of a URL? For example, if a URL ...
0
votes
1answer
29 views

Changing font size to percent in theme [closed]

I want convert font size in existing theme from px to percentage. The theme and the CSS. Should I change font-size in body and headers only, or better to change font size in all places in CSS? What is ...
1
vote
1answer
24 views

Where to start with creating the theme for selling? [closed]

I have the task to create the Drupal theme from the existing Wordpress theme that will be sold on ThemeForest. This is the first time that I'm doing something like this, up until now I was doing the ...
0
votes
1answer
22 views

add jquery to drupal website

I want to add 2 jquery scripts to my website that have to be executed on every page. Smoothstate <script src="jquery.smoothState.js"></script> <script ...
0
votes
2answers
19 views

theming the views widget ($widget) in views exposed filters

I need to remove all the divs inside the $widget of a views exposed filter. I need only the single form fields without any html around it. I unfortunately don't speak PHP... Can anyone help me ...
2
votes
4answers
54 views

How to include the same menu twice in a .tpl file

I am working on a responsive design for a site I am building and I currently am having trouble including the menu twice in the header template file. I need the menu displayed inside the content ...
1
vote
1answer
90 views

How can I a revert an overridden template to its default in a sub theme?

If a base theme overrides a certain template, how can I tell a sub theme to revert to the default template instead of using the overridden template? Of course I could simply copy the default template ...
0
votes
0answers
13 views

Enter key act as Tab key on Textbox in Drupal theme

I am using drupal a Content Type as data entry that contains more than 25 Textboxs. How can I make enter key act as Tab key on Textbox in my drupal theme? I tried a lot of codes like this: ...
0
votes
0answers
14 views

THEME_preprocess_field() not recognised in template.php

Mail (password reset, user blocked etc..) from admin sends messages without preserving linebreaks. Then I came across https://www.drupal.org/node/1095838 to fix this issue. In turn ...
-3
votes
1answer
16 views

Create a template file for view field? [duplicate]

How do I create template file for view field, My view machine name is page_search and field name is room type.
0
votes
1answer
36 views

Custom Page Create

I create page--hospital.tpl.php file. To call this page, then I create Basic Page and Page title is "Hospital". I provided on the Menu Link and I typed "hospital" in URL path alias. Then, Save the ...
2
votes
2answers
22 views

placing a menu block inside a views template

I need to place a menu block (the main-menu) inside a views template file - the template for the rows design. I tried $block = module_invoke('system','main_menu'); print render($block['content']); ...
0
votes
1answer
26 views

edite content type style

I clone content type by using bundle copy module, but the view of the content type never the same as the first one, how can I clone the style too
2
votes
1answer
50 views

access node title in field.tpl.php

I would like to access the title of the node a field belongs to in a field.tpl.php file. My goal is to transform the field into a mailto link that would use the node title as the subject field. Is it ...
0
votes
0answers
22 views

How to display custom field label added by CCK in node.tpl file?

I have a new content type called hotel and have added a field called timing. For display in node.tpl.php, I can use field_view_value() but how do I get the value for the label. I know I can use the ...
0
votes
1answer
28 views

Simplenews. How to use custom mytheme/node--type.tpl.php on email?

How to use custom mytheme/node--type.tpl.php on email?
0
votes
0answers
10 views

How to theme a commerce order differently when the order is being viewed from inside admin/ path?

I have this orders, that users can access from: /checkout/order_id I want to theme only the admin's path, from: /admin/commerce/orders/nid Should I just use commerce-order.tpl.php? As that ...
0
votes
0answers
8 views

Edit a template based homepage (Bluez) as node?

I've downloaded the Template "Bluez", but Is it possible to edit it's fixed-built homepage as a node and add some fields to it with the program itself? thanks.
0
votes
1answer
19 views

Why is page tpl not getting detected

I have a view with page display's page setting as following: Path: some/path Menu: No Menu However it was overridden in templates by page--some--path.tpl.php for styling purposes. This tpl actually ...
0
votes
1answer
95 views

Drupal 8 - Custom classes for menu links

How can I add custom classes for links into main menu in Drupal 8. This is template for my main menu called menu--main.html.twig {% import _self as menus %} {{ menus.menu_links(items, attributes, 0) ...
0
votes
3answers
116 views

Drupal 8 custom page template

Is there any way to make custom page.html.twig template in Drupal 8? By default Drupal generates some suggestions but none if it is something like this page--node--content-type.html.twig..
1
vote
1answer
48 views

How to style a programmatically created page with a template?

I'm struggling with understanding theming pages with templates. I'm stuck with creating a new template for a programmatically created page. I have a module that shows a download page for a file. The ...
1
vote
0answers
36 views

How to get product attributes (weight, dimension.height..) in php

I am fairly new to drupal commerce and php so pardon the dumb newbie question. I downloaded commerce_order_ftp_export and after updating it to the devel version I was able to get it working. It ftps ...
0
votes
0answers
52 views

Render webform submissions in template

I want to render webform submitted data below the form on every page from a specific content-type. But not all fields are allowed for everyone to see like a phone number, views could solve that but ...
0
votes
0answers
22 views

Duplication of code when creating custom block template

I'm a newbie in Drupal but I'm working on a project with drupal 7 and I'm going out of my mind. I have a block which content must be wraped by different links if is seen on desktop or on mobile ...
0
votes
3answers
58 views

Cannot apply custom CSS via theme settings [closed]

With Drupal 7.x and the Whitejazz theme, I want to apply custom CSS styles to some elements. This theme has the option to include custom CSS styles by specifying the path to the CSS file (in ...
0
votes
1answer
31 views

Difference between #type and #theme in Render API

I am reading this theming article http://themery.com/dgd7/advanced-theming/render/manipulate and I have a question. This article has the following code: $page['highlighted']['new_stuff'] = array( ...
0
votes
1answer
61 views

Render multiple values of a field in Drupal 7 [closed]

I created a custom content type with a field with multiple values which I want to render as follows in my node--custom_content.tpl.php; <div class="CLASS" style="background: url('<?php print ...
0
votes
0answers
14 views

Print D7 one-time reset password message/form (after mail sent)

Is it possible to render the one-time password reset message you are linked to from your reset password e-mail? Note that it is not the form where you type your mail to reset, its this message: RESET ...
0
votes
0answers
26 views

node.tpl.php is not getting picked

I have a content type called news, I wanted to create a custom template for it because I had to embed a view just before the title. I created node--news.tpl.php and placed it in templates folder but ...
0
votes
0answers
21 views

Problem getting context module for Drupal 7 to load template

I am using the Context module for Drupal 7 and am experiencing the following problem (I suspect I am missing something basic here): I am trying to select a different template to use for the user ...
2
votes
1answer
51 views

Which external frameworks does Drupal use, if any? [closed]

I'm looking for ways to prepare and ease a transition to Drupal. My department is planning on completely rebuilding our custom CMS in Drupal. There are 4 members on the team, two programmers. I've ...
0
votes
2answers
31 views

How do I include jQuery scripts at the bottom of the <body> tag?

I want to include a JavaScript file at the bottom of the <body> tag, and I only want to include it for a specific node type, but my node.tpl.php file's content is only wrapped by ...
0
votes
1answer
21 views

URLs getting duplicated for the same node

Yesterday, I found a strange behavior with my drupal site. I noticed all the nodes are getting duplicated like this: Original node's url will be www.livesite.org/?q=node/2 And when I append ...
1
vote
1answer
51 views

Test if template files (.tpl.php) are used by theme

I've inherited a custom Drupal 7 theme with many template files. I'm sure lots of them aren't actually used by the website, and were part of the testing process. Is there a method to list which ...