For Programmers: Free Programming Magazines  


Home > Archive > PHP Smarty Templates > March 2004 > Using a default template directory









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Using a default template directory
Benjamin Sims

2004-03-19, 1:28 pm

I would appreciate any ideas on how best to approach the following:

I have several sites running on a same server based around a home-grown CMS
using Smarty. The sites tend to be similar, but occasionally a change is
needed to the template for a particular site. At the moment, I have a folder
for the full set of templates for each site. However, this is a pain if I
want to make a 'global' change.

I have a config file that specifies the templates directory when a page is
loaded, which is then used by the Smarty sub-class constructor. What I would
really like though is to be able to specify both a 'default' and a
'specific' templates directory, such that Smarty would first check for the
template in the specific directory, and if it was not found use the default.

I know that I could do this at the PHP level with a PATH directive, but I
don't want to go this way.

Thanks for any tips,

Benjamin
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com