(Tips) Custom Drupal Templates by Path
Custom Drupal Templates by Path
-
Drupal Template Suggestions
Drupal's standard template naming works like the following example according to this information.
-
For example, if you were to visit example.com/node/1/edit, PHPtemplate would look for the following templates, in descending order:
page-node-edit.tpl.php
page-node-1.tpl.php
page-node.tpl.php
page.tpl.phpThat's all fine and good, and works as expected. However, while working on iShrink.org yesterday, I needed something a little different than I usually do. Each of the main pages on that site require a completely different template, and as the site nears completion, several of the core pages will probably completely change layout. This poses the need that all of those pages have their own page.tpl.php template file.
-
Using the built in Drupal template suggestions, for the about page at iShrink.org/about, I could use the template page-node-1.tpl.php. As well as using page-node-2.tpl.php for the page at iShrink.org/services.
Courtesy : http://himerus.com
- guru's blog
- Login to post comments
![Drupal-6-Book-[Building Powerful and Robust Websites with Drupal 6].jpg](http://www.drupalranch.com/images/Drupal-6-Book-[Building%20Powerful%20and%20Robust%20Websites%20with%20Drupal%206].jpg)