New Podcast

Posted Tuesday, July 27 at 2:29 pm

Ryan Price and Mike Anello recently talked with Jacob Redding (jredding), author of Beginning Drupal as well Treasurer and Interim General Manager of the Drupal Association.

Download Podcast 41
DrupalEasy_ep41_20100727.mp3
Syndicate content

NEWSLETTER

Stay informed on our latest news!

Syndicate content

Testimonial

On March 11th I attended the first DrupalEasy Workshop in Orlando, Florida. I'm an experienced web developer who has recently picked up Drupal as a tool for helping to build high quality content-driven websites. Mike and Ryan were excellent teachers - they gave a thorough overview of a complex topic in a short space of time, and provided plenty of resources for us to continue learning. The workshop is essential for anyone who has previously configured a basic Drupal site and wishes to take their skills to an advanced level. I would not hesitate to recommend DrupalEasy.com training and hope to attend more workshops in the future.

Who are we?

DrupalEasy is the collective expertise of Ryan Price and Michael Anello, who joined forces to provide training and consulting services worldwide. Read all about them and what they can do.

What is Drupal?

Drupal is a free, super-powerful content management system for sites that require information posting and collection, including blogs, forums, videos, photos, and databases of information. We think it is the best platform available. Here's why...

Why Drupal?

More and more savvy organizations are going with Drupal for content management, and its no mystery why. It’s free, flexible, and easy to maintain for small or large volume sites. Learn more...

Overridding the node.tpl.php File

If you've done much Drupal theming, then you're probably aware that you can override the default node.tpl.php template file on a per-content type basis. For example, if you have a content type called "food", then you can create a node-food.tpl.php that will be used only when nodes of type "food" are displayed.

A full list of template suggestions can be found on drupal.org.

There's a couple of "gotchas" that you need to be careful of when overriding node templates - as well as any other template files as well. First - whenever you create a new template file, be sure to clear your cache. Second, be sure your node template uses the "machine name" for the content type in the file name. For example, if you have a content type named, "Imageboard" and the "Type" is "image_board", be sure your node template is named, "node-image_board.tpl.php" and not "node-imageboard.tpl.php.

One final gotcha is that if you're using a subtheme and you want to use a custom node template for a particular content type, you'll also need to include a default node.tpl.php in the subtheme or your custom node template will never be seen by the theming engine.

Trackback URL for this post:

http://drupaleasy.com/trackback/339
No votes yet

1 comment

Guest wrote 21 weeks 6 days ago

Thanks!

That was easy! I created the node, but refresh did not work. I need to clear cache.

Syndicate content