Firefox PHP

Using a template search path

Posted by Maurice Makaay 
All files from this thread

File Name File Size   Posted by Date  
template_searchpath.hack.txt 1.6 KB open | download Maurice Makaay 10/11/2005 Read message
Using a template search path
October 11, 2005 09:30AM
On my site, I am now using a hack that arranges that I only have to put the template files in my template directory that I want to change in comparison with the default template. If my template directory does not contain the tpl-file, the system will automatically fallback to the default template. This way, you could create a template directory with only header.tpl, footer.tpl, css.tpl and settings.tpl and let the rest of the templates files come out of the default template.

The hack only requires some changes to the phorum_get_template function in common.php. This hack is written for 5.1.3-alpha. Do not use this hack for 5.0.x releases, because it will break stuff.

There's one catch: the template system will not be able to detect if you remove one of your own templates if that template is used as an include by another template (but I guess you won't be doing that too much). If you do, you can work around it by emptying the tpl-*.php files your cache directory.

See attachment for the modified function.
Attachments:
open | download - template_searchpath.hack.txt (1.6 KB)
Sorry, only registered users may post in this forum.

Click here to login