Drupal Snippets & Tips

Submitted by Jean E. Gazis on Sat, 2009-01-24 18:38.

Find your variables'

by pwolanin

put this in any *.tpl.php file to find out the names of all populated variables:
All variables in this tpl:

Disable "submitted by" on content types

In D5 its in administer -> site building -> themes or: yoursite.com/admin/build/themes if you so choose.

click the configure tab at the top
next page, look to top right corner box, remove post information for the content types you choose not to have this information displayed on.

List of core templates and suggestions

by smerrill@drupal.org

Here's another useful resource for getting started theming:
http://drupal.org/node/190815
That page lists all the templates available in core, and also all the template suggestions that core will try (look for Template Suggestions.)
As an example, Rob mentioned that while you can make a page-node-214.tpl.php to theme the entire page around the node with ID 214, you can't make a node-214.tpl.php, because the template suggestion for node templates is very simple: node-[type].tpl.php.
So if our hypothetical node 214 was a story, Drupal would only try node-story.tpl.php and node.tpl.php to output the content of that node.
Great job to everyone who helped put this together and especially Rob for giving a great presentation!

( categories: )