0

I've got a Drupal 7 site with a default theme (Nuboot_Radix). How do I find out which template files (.tpl.php) are being used on each page. For example, I have the following page:

enter image description here

How do I find out which file to change in order to change how the datasets are displayed here (in this case Age by Economic activity 2011, 2011 UK Borders, Ethnic group 2011).

I understand that I need to make these changes in a subtheme, which I have already created. But I don't know what to call the tpl.php files, what the put in them, what variables I can use, etc. If I could find out where the html was being created for that section then I can figure out the rest myself.

I have been advised in another drupal post to not use Theme Developer since it is no longer supported.

1 Answer 1

0

tpl.php files are called templates in the Drupal system. They render the HTML that you see on any given page, may it be a block/view/panel or anything.

Theme Developer is a popular module used to pinpoint the template file that's in play. I suggest you try it to better understand how template system works. To understand more on customizing templates and naming conventions read through this guide on working with template suggestions.

If its a view you want to modify- Use views GUI to the maximum extent(changing the sort order, re-arranging fields etc.). Still not getting what you want ? Override view templates for maximum control.

(Helpful Articles on overriding view templates)

http://www.wdtutorials.com/drupal/views/how-to-create-custom-template-view-drupal-tutorial-article

https://www.interworks.com/blog/carmstrong/2013/02/27/quick-tutorial-overriding-drupal-views-using-templates

3
  • Your advice is appreciated, however I have already used Theme Developer but ran into problems, as documented in this Drupal.Stackexchange.com post. I was advised not to use it since it is no longer supported. I shall add this information into the main question.
    – reelyard
    Jun 15, 2017 at 13:28
  • One of the articles you linked to pointed me towards adding $conf['theme_debug'] = TRUE; into my settings.php which allows me to view which nodes are being used when viewing the page source in Chrome.
    – reelyard
    Jun 19, 2017 at 9:19
  • @mohnjatthews Glad you figured. For anyone who might need this in future- OP was referring to drupal.org/node/223440
    – dharma
    Jun 19, 2017 at 14:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.