Skip to Content

cool features in new phptemplate

Alaa's picture

just two new cool features in Drupal's PHPTemplate theme engine (which BTW is going to be the official drupal theme engine next release).

Dynamic FaviIcons

if you place a favicon.ico file in your theme directory phptemplate automatically adds a link tag to reference it, this is very useful for multisite setups which need to have several favicons served from the same filebase.

Node Object on page level

PHPTemplate uses template scopes, there is a template file for each scope, so there is a page template, a node template, a block template, a comment template etc.

now it used to be that each template scope has only the minimum info needed for rendering the object (which makes perfect sense actually), but the new phptemplate broke the rules a bit to give us extra power, the node object is now available on the page template which means we can change the whole design according to node type.

hell we can change it according to anything, regexp rule that checks content (b0rk the page when someone mentiones VI for instance), we can indicate poll results on the page background, etc.

now combine this with a the keywords module, and you now have a way to pass arbitirary arguments to your theme when you create a node.



Dr. Radut | blog