Re: [SMARTY] Templates Dir
| From: | Monte Ohrt | Date: | Wed, 24 Apr 2002 15:58:00 +0000 |
| Subject: | Re: [SMARTY] Templates Dir | ||
| References: | 1 2 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-3871@lists.php.net to get a copy of this message | ||
The problem here is if you include other templates within your templates, you'll have to use the full path every time.
You could set the template_dir first:
$smarty->template_dir = $my_template_dir;
$smarty->display('index.tpl');
Another way is using one template directory with subdirectories for each theme, then use a variable to control which theme is used. Check the mailing list archives for lots of discussion and examples.
$smarty->display("$theme_name/index.tpl");
Ray wrote:
Okay i think i might have found a work around using $smarty->display("file:/path/to/my/templates/menu.tpl"); SO i can use my class within this line to display my template dynamically like so <? $smarty->display("file:$theme->tpldir/signup/agreement.html"); ?> Will there be any issues with this and caching? Or is there a better way? I havent touched the caching yet and caching is not on since we are still in development but im kinda concerned that there will be issues with caching since i see a lot of posts regarding it. ----- Original Message ----- From: "Ray" <rayge99@hotmail.com> To: <smarty-general@lists.php.net> Sent: Wednesday, April 24, 2002 10:14 AM Subject: [SMARTY] Templates Dir Okay im sure this has been discussed before but Im trying to create a dynamic path for Templates so our app can be themed in numerous ways and just by changing a variable it will change the path to the new theme therefore changing the look of the app. Basically I just need to know where to go to change the function that uses this line so it uses my new class for the template path-- Monte Ohrt <monte@ispi.net> Director of Technology, ispi Inc.var $template_dir = '../themes'; // name of directory for templates