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

learn more… | top users | synonyms (3)

0
votes
0answers
7 views

Where is the PHPTemplate in template files?

There is a default templating system PHPTemplate in Drupal, they say. But where can I see it? I don't see anything more than pure php in template files .tpl.php. Once I've seen template system ...
1
vote
0answers
11 views

Pass variable to field template from theme_preprocess_field()

I'm stuck trying to pass variables from my theme_preprocess_field function to my template file. I want to have a variable for each of the fields I am printing out to my template. I'm using the ...
0
votes
2answers
36 views

Add content type to body class

I want to add a body class for the content type of each node. Drupal already provides this, but it isn't always consistent between the Node view, the Node/Add view and the Node/Edit view. This makes ...
0
votes
1answer
50 views

My battle with drupal's form

In the ancient times when things were easy, you just had to code a form in html and then your php would typically have a if($_REQUEST['some_value']) to handle the request. But now with Drupal, nothing ...
0
votes
0answers
20 views

Short code is not working with rendering the field in node template [on hold]

I am using shortcode module and create custom shortcode. When I individual rendering the field collection field on the template, its not working, but If I rendering the body field like this print ...
1
vote
0answers
10 views

Change the #formatter of a field when printing it in a tpl.php file

In my node.tpl.php I have used KPR on a field. I notice that is has a lot of options like ['#formatter']. I would like to change these options when I print the field out in my node.tpl.php file. How ...
0
votes
1answer
23 views

Create Drupal 7 page specific tpl files without using node ID's

i know you can crate custom tpl files for a specific page by doing the following: html--node-999.tpl.php But this doesnt work well if the node-id is going to change when switching environments or ...
5
votes
2answers
107 views

Render a field contained inside of another field

I am using Drupal Paragraphs module that lets you create "bundles" of fields inside other fields. (It does this using entities). Each bundle has it's own tpl.php file. In addition, you can nest ...
0
votes
1answer
23 views

Replace field label in content type template [duplicate]

I'm outputting fields in a template for my content type like so: print render($content['group_details']['field_city']); However, I would like to replace the default label that is attached to the ...
0
votes
1answer
14 views

field renders with 2 spaces

In a template I'd like to get an html tag from a field: <?php print '<' . render($content['field_headline_format']) . '>'; ?> This should render or depending on the value of the ...
1
vote
1answer
34 views

Drupal 7 field collection tpl no output on render

I'm using Drupal 7 with field collection module. I have my tpls setup and being triggered using the render function; however, even though the tpls are being executed, the output is being thrown away. ...
1
vote
0answers
18 views

Different templates for generating different PDF files related to a single node

Im using PDF using mPDF to generate PDF files related to a node. Inside the code of the module there is a preprocess function that add to theme_hook_suggestions a new pdf template that can be used ...
1
vote
1answer
38 views

How to use a tpl.php file for a theme function

I am using LoginToboggan which provides a theme function. You can use this theme function in a template.php file to control the mark up. However, the code becomes quite unwieldy in template.php. Is ...
1
vote
1answer
26 views

Theme a specific view with Twig

Is it possible to write a twig template for a specific view? I have a view with multiple blocks and I want all these blocks to look the same. But I am having trouble with my views actually knowing ...
0
votes
1answer
18 views

How to theme main menu in three columns

I have a main menu block which i am showing at top-navigation. I need to theme main menu but not sure how to apply classes to the root level menu items and sub menus. i tried below snippet but not ...
0
votes
1answer
18 views

Why is my custom block template applying to all blocks?

I have a region on my home page called home_area_1. It contains several blocks. I want those blocks to be formatted in the same way, so I created a template called block--home-area-1.tpl.php. It is ...
0
votes
2answers
33 views

How do I override a module template (.tpl.php) from my custom subtheme?

I've seen how to override module templates from other modules and theme templates from subthemes, but how do I override module from subtheme? The file is under the profiles folder. Edit: I'm using ...
0
votes
1answer
15 views

How would I insert one item into the user-edit page with templates?

I'm looking to insert a button into the user edit page. I've seen examples of how to edit the entirety of the user-edit page, but I want to keep everything intact and only make one small change. Is ...
0
votes
0answers
7 views

Search Results Templates Strange Cacheing Behaviour

I've been trying to resolve an issue with my search results templates. There are two scenarios that I could really use some help with understanding: I have no search result templates inside my ...
0
votes
0answers
6 views

How to modify the commerce price formatter label to match shipping service?

Please see attachment. Using Commerce Kickstart 2. I have a working solution, but I am hoping someone can tell me how to improve it, as it 'feels' poor. The footer for the default shopping cart view ...
0
votes
0answers
7 views

Hide product from one custom page while two custom pages controlling from admin in drupal 7?

I have start working on a existing product based site. I have found a page shop/product is running through custom drupal code inside theme folder. This page showing list of the product with product ...
0
votes
1answer
29 views

Correct way to render fields from Entities?

This very popular article explains correct way to render fields: http://www.computerminds.co.uk/articles/rendering-drupal-7-fields-right-way According to the article, the correct way to render fields ...
0
votes
0answers
20 views

Can't override links__system_main_menu in Drupal

Im working on my custom theme (modified stark theme) and there is a main menu in page.tpl.php generated by: <?php print theme('links__system_main_menu', array('links' => $main_menu, ...
0
votes
0answers
6 views

Calendar Module: Year view - Customise Month format

I am using Calendar Module to create a Year View. At the moment, the headings for each month are displayed in the following format: Thursday, January 1 I only want to display the month (e.g. ...
0
votes
1answer
14 views

Content Type Content Theme Template

Is it possible to make a template based on node content? For instance, is it possible to page--[node-type]--%.tpl.php or block--[content-type].tpl.php or page--[content-type]--%. I tried ...
0
votes
1answer
13 views

Add body class to Node Display (to distinguish it from Node/Edit or Node/add view)

I want to add a body class that will only appear on the actual node display (e.g. mysite.com/node/1). I don't want this body class to appear on the node/edit page (e.g. (mysite.com/node/1/edit) or the ...
0
votes
1answer
43 views

Node.tpl.php file: Check is several fields are empty

On my node, I have three location fields (primary, secondary, code) and three object fields (food, fuel, accommodation). I want my node.tp.php to check if all the location fields are empty or if all ...
0
votes
1answer
35 views

Field Template Suggestions: Target a particular field type on a content type

I want to use a field template for all the fields on my "journal_page" content type that use a widget of "long text". How would I do this? N.B. My field is not named "long text". "Long text" is ...
0
votes
1answer
12 views

Add body class to both Node add and Node Edit Page

I want to add a Body class to my Node Add pages and my Node Edit Pages. How can I do this? I know that I need use the following in template.php to add a class to Node Edit: function ...
0
votes
0answers
57 views

Get header HTML content within a custom module

I have a custom module where I need to serve the content from the header and the footer into a blank webpage. This functionality is required by a 3rd party service and is not served to users, I have a ...
1
vote
2answers
42 views

How can I apply different templates based on taxonomy hierarchy?

I'm new to Drupal and I don't have extensive knowledge so I'm hoping I can get this question answered. I want the taxonomy pages of lower hierarchy to be displayed differently from the higher by ...
0
votes
0answers
20 views

Drupal 7 Views: Assign templates to specific views (possible via template.php)

In Drupal 7, Views have multiple view-displays (e.g. block, Page etc). If you click Theme, it will give you specific names to use to template for these view displays. However, this isn't very ...
0
votes
2answers
23 views

Printing fields in theme: Undefined index: safe_value

I want to print my fields in tpl.php files as cleanly as possible. To do this, I have used the following code in my template.php file: function print_field($field_name, $format = 'safe_value') { if ...
0
votes
2answers
33 views

Can't find html.tpl.php

I'm editing the Seven template in drupal 7. To have the backend of drupal as I want. Everything is going great but what I want is to change something in the html.tpl.php but I can't find where it is ...
0
votes
0answers
9 views

Getting specific translation string for display

In a nutshell, I'm attempting to have the site name displayed, and right below it, to have it's French version displayed below using the following code. <?php if ($site_name): ?> <!-- !Site ...
0
votes
0answers
19 views

Theme a form element in drupal with template file?

I wanted to ask you if its possible to do following things: My form consists of three elements. 2 Dropdowns and one custom element. The second dropdown values are getting rendered when I choose a ...
2
votes
2answers
108 views

Using orderBy correctly with hook_query_alter

I have a hook_query_alter function that I'm using to edit my search.module results. It works ok so far. However, I'm having trouble adding an orderBy condition that I need. Here's the SQL I want added ...
2
votes
1answer
106 views

Where do I add imagemap in drupal 7

I'm using marinelli theme and the rotating images. Now, I'm looking to add usemap to some of the images, as the images are rotating images and are not within a specific node. Moreover, I'm adding the ...
2
votes
1answer
33 views

Using theme_get_setting getting empty value

I am using theme settings in my Drupal 7 theme to provide a theme option as follows. $form['mythemename_settings']['loaderImage'] = array( '#type' => 'fieldset', '#title' => t('Loader ...
0
votes
1answer
29 views

Unable to override theme function

I am trying to override the 'link_field' theme function in the Link module. I've put this function in my template.php of my active theme and have cleared the cache, but its not overriding. What am I ...
0
votes
2answers
50 views

Theme expanded menu item?

Does anyone know how I can theme the entire li output for an expanded menu item? For instance, the output is I want to change the output to: Is there a way to theme this output, like there is a ...
0
votes
1answer
10 views

How to theme a view that displays content from a relationship?

I have a page for Organization. Each organization has a Featured Person field which is an unlimited node reference to the Person content type. The organization can have many featured people. I also ...
0
votes
1answer
114 views

IDs for content type fields

how can you add the ID to the content type fields (drupal 7), all I see are classes, and from my understanding seems that there is nothing in the variables. Please keep in mind I am not coder, and ...
0
votes
2answers
39 views

field output dependend on mime type of another field

I have a node type with 2 fields: preview_image and file (multivalue). I can upload image and video files. For the output I need the following: The preview_image should only be displayed when the ...
0
votes
0answers
5 views

Drupal 6, form validation and use of a template #2 [duplicate]

Can anyone explain why my form does not validate when it's using a template file in Drupal 6? Here's the code... <?php function wdacustomForms_tellMeMore_form($form_state) { $form['#attributes'] ...
0
votes
0answers
13 views

Drupal 6, form validation and use of a template

Can anyone explain why my form does not validate when it's using a template file in Drupal 6? Here's the code... <?php function wdacustomForms_tellMeMore_form($form_state) { $form['#attributes'] ...
0
votes
1answer
21 views

Giving custom argument value in 'q' variable

We want to use a custom template page when a specific value is given for the q variable in url . For example if we give http://localhost/drupal/?q=xyz/123 , we want to use a custom template page ...
0
votes
1answer
29 views

Creating a dynamic URL in node--resource.tpl.php

I'm trying to create a URL in my node--resource.tpl.php file that contains fields from the resource in question in the URL. The following code is what I've been playing with, but when the user clicks ...
0
votes
2answers
26 views

Customizing a Views HTML

I'll start off saying I'm pretty new to Drupal. I'm trying to customize the way a view displays. I want it to look like the Industry News section on this page: ...
0
votes
0answers
33 views

Programmatically get input format in field template

We change some output in our field.tpl-files for body fields, depending on the input format that was used on the node (which itself depends on the user being able to modify it). Now this worked by ...