RE: [SMARTY] Changing Templates

From: Date: Wed, 16 Oct 2002 15:29:32 +0000
Subject: RE: [SMARTY] Changing Templates
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-6179@lists.php.net to get a copy of this message
Something that's worked for me, mostly for transisitioning the site into a new layout, is to put the files in a subdirectory of your template directory... then they can even have the same name but the compiled files will be different. For instance, when our designer redid the layout for our site, I made a _template_dir_/new folder, and put all of the new templates in there, some with different names, some with the same name. For testing, I set up an if statement in the php that called smarty, so if I passed new=true in a query string on the page, it would display the template for that page from the new/ directory instead of the templates dir... you could do something similar in your case. -- Josh -----Original Message----- From: Cameron Cooke [mailto:cameron@toucanresolve.co.uk] Sent: Wednesday, October 16, 2002 7:26 AM To: smarty-general@lists.php.net Subject: Re: [SMARTY] Changing Templates Hi I can't get this to work. It has created separate caches in the cache folder, this seems to work ok. But has no effect on the template. If I delete all the folders in the templates_c directory this works and the template changes. Any idea why, or what I need to do. Thanks for your help Cameron Cooke Toucan Resolve Ltd. "Jeroen Roosenboom" <jr@roosenboom.com> wrote in message news:MPELLHDHKFAMIFKIIOJBCEHCCMAA.jr@roosenboom.com... > Cameron, > > Probably the template files in the different style(skin) directories, have > the same name. This confuses the Smarty compiling part. > Two ways to solve this problem: > - rename the files :o) > > - use $smarty->assign("template.tpl", $cacheid) > the $cacheid could be anything, but for you it would make sense to use the > skin name. > For more info, manual: > http://smarty.php.net/manual/en/caching.multiple.caches.html > > Jr > > >> > > Hi > > I have made a site, and I am using smarty templates for the design. I have > created a templates dir in the web root and created folders in side it named > template1, template2, template3 and so on. > > Now the idea is that I can change the template path in my site and the site > will just switch to another template (skinning). This sort of works, but is > behaving strangely. When I change the template path in my setup.php file > that I have. It don't change the site design until the templates are edited. > I thought this was a caching problem so I turned this feature off. but that > had no effect. The caching works when I turn it off because any database > stuff gets updated, but the actual template don't. > > Does any one know what I am doing wrong here. > > Thanks for you help > > ------------------- > Cameron Cooke > Toucan Resolve Ltd. > toucan@tiscali.co.uk > > > > -- > Smarty General Mailing List (http://smarty.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Smarty General Mailing List (http://smarty.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.smarty.general (#6179) next »