Drupal's PHPTemplate theming engine uses naming conventions to easily theme nodes. While the standard template used is named node.tpl.php
, other naming conventions are available to target specific subsets of nodes. Here, we will be looking at specifically theming content of a particular node type—story
—by removing information about its categories and submission fields during display.
This recipe uses the myzen theme created earlier in this book as an example theme. As we are targeting particular node types, it will be a good idea to have more than one node type enabled along with sample content for each.
The following steps are performed in the theme folder, which in this recipe is sites/all/themes/myzen
. Zen-based themes store their template files in a templates
folder while others might choose to store them in the base folder.
myzen's
templates
folder should contain anode.tpl.php
file. If this is not available...