What are the Advantages of using Module Template System

Last updated on
30 April 2025

The biggest advantage is giving your custom modules a flexible template system that mimics D6's phptemplate engine in that it allows template files to be located in the theme directory OR in a module directory. Another HUGE advantage is the ability to inject variables AND functions right into the template file. No need to tell a themer 'You need to add xxxxx to template.php'. Your module can do it for them since it has direct access to the template unlike the theming layer of D5 where it is SO detached that you are limited in what you can make available to a template. No more being limited to just $node or whatever other variables they allow you to modify. Restriction can be good 95% of the time, but that other 5% of the time makes this module necessary. This doesnt mean the themer has to wait for you to add something to a module though to make it available. They can also use $theirThemeName/custom_template.php just like the would use the template.php file. The main difference is that its more flexible in what they can do in it. It's not restricted in anyway and they could even turn it into a module of their own if they wanted to.

Help improve this page

Page status: Not set

You can: