RE: Variable template directories.

From: Date: Thu, 07 Mar 2002 13:44:03 +0000
Subject: RE: Variable template directories.
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-2966@lists.php.net to get a copy of this message
This is what I use to make the template choice dynamic: I always create a new instance of SMARTY at the top of my scripts one time. // We need to find the template for this website // ================================================== $template Location = "Some template absolute bath"; // This could be dynamically chosen from a DB // Create the instance of Smarty and set the location of the templates // using the template Location variable // ====================================================== $smarty = new Smarty(); $smarty->template_dir = "/home/someone/public_html/templates/$templateCode"; $smarty->compile_dir = "/home/someone/public_html/templates/$templateCode/compiled"; $smarty->config_dir = "/home/someone/public_html/templates/$templateCode/configs"; Mike -----Original Message----- From: Apache User [mailto:apache@academyoflearning.ca]On Behalf Of IpSo Sent: Wednesday, March 06, 2002 6:59 PM To: smarty@lists.ispi.net Subject: [smarty] Variable template directories. I 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 the user can switch between them on the fly. Would this be a recommended way of doing it? IpSo -------------------------------------------------------------------- Never worry about viruses in your Email again. Get your FREE! virus scanned Email accounts at http://snappymail.ca --- You are currently subscribed to smarty as: mweck@cfl.rr.com To unsubscribe send a blank email to $subst('Email.Unsub') Visit Smarty's homepage at http://www.phpinsider.com/php/code/Smarty/

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