Monday, January 11, 2010

Dynamically Styling Nodes

PHPTemplate provides a specific template for nodes—node.tpl.php. Using the
same principles of precedence we've seen throughout, you can provide alternative node templates to suit your needs. To provide a template for the blog node, for example, create node-blog.tpl.php; for the story node, node-story.tpl.php. In the absence of a more specific template, the system will apply the default node.tpl.php file. The table below shows the suggestions for the default system:

























Suggestion Affected node
node-blog.tpl.php blog entries
node-story.tpl.php story entries
node-page.tpl.php page entries
node-forum.tpl.php forum entries
node-book.tpl.php book entries

No comments: