Re: Variable template directories.
| From: | IpSo | Date: | Thu, 07 Mar 2002 08:07:30 +0000 |
| Subject: | Re: Variable template directories. | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-2961@lists.php.net to get a copy of this message | ||
Quoting Luc Saint-Elie <luc@saint-elie.com>:
Hello, You may want to try something like $smarty->display('file:/home/foo/bar/templates/$themeID/templatename.tpl'); But then I would have to do that in each script that calls that template? Thiswould work I suppose, but even better would be to set Smarty's template dirs dynamically, then I only have to it in one place? I currently use a line like this: $smarty->display('prefs/templatename.tpl'); So now if the template dir is changed dynamically in the Smarty class itself, (one place) it in theory it would like: SMARTY_DIR/templates_theme1/prefs/templatename.tpl or SMARTY_DIR/templates_theme2/prefs/templatename.tpl or SMARTY_DIR/templates_theme3/prefs/templatename.tpl ...
At 15:58 06/03/02 -0800, IpSo wrote:IpSo -------------------------------------------------------------------- Never worry about viruses in your Email again. Get your FREE! virus scanned Email accounts at http://snappymail.caI would like to offer a "themeable" website, and I figured Smarty would be perfect for such a thing. I could make the templates for each theme, put them in there own directory, ie: SMARTY_DIR/templates_theme1 SMARTY_DIR/templates_theme2 SMARTY_DIR/templates_theme3 Then have a variable that sets the template directory on the fly, so theusercan switch between them on the fly. Would this be a recommended way of doing it? IpSo -