RE: [Fwd: Re: [SMARTY] Set config file from php?]

From: Date: Thu, 09 May 2002 14:16:10 +0000
Subject: RE: [Fwd: Re: [SMARTY] Set config file from php?]
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-4122@lists.php.net to get a copy of this message
I use CSS for color schemes, but I do put META tag keywords and some navigation information in the config file: site_name = Foo phone_number = Bar work_hours = Baz [home] page_title = Home page_name = home nav_text = Home meta_keywords = Blah,blah,blah meta_description = Your description here --- In the page template: {config_load file=site.conf section=home} {include file=header.tpl site_name=#site_name# page_title=#page_title# page_name=#page_name# nav=$nav} --- In the header.tpl: <meta name="keywords" content="{#meta_keywords#}"> <meta name="description" content="{#meta_description#}"> <title>{$site_name} - {$page_title}</title> etc... >-----Original Message----- >From: rmroczk@mroczka.com [mailto:rmroczk@mroczka.com]On Behalf Of Bob >Mroczka >Sent: Thursday, May 09, 2002 8:48 AM >To: smarty-general@lists.php.net >Subject: [Fwd: Re: [SMARTY] Set config file from php?] > > >I found a neat method that works for me. >I have a templated named header.tpl that is included >from all my "master" templates. In that file I >have this: > ><{config_load file="web.conf" scope="global"}> ><{config_load file="global.conf" section=#colorscheme# >scope="global"}> ><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> ><html> >.etc. > >I have a global config file with sections for each color scheme >like this: > >[1] >color = #003399 >background_color = #ccccff > >[2] >color = #000099 >background_color = #9999ff > >Then my web.conf file has this: >colorscheme = 1 > >And I get the colorscheme I want into my output files. > >Ivan Voras wrote: >> >> On Thu, 9 May 2002, Monte Ohrt wrote: >> >> > {config_load file="$template/display.conf"} >> > >> > (in config_dir) >> > >> > /mytheme1/display.conf >> > /mytheme2/display.conf >> > ... >> > >> >> well, yes and no. I see now that it would be a very nice solution IF my >> current themes system was organized that way from the start. >> >> My layout is like this: >> >> /img/themes/theme1/pic1.jpg >> /img/themes/theme1/pic1.jpg >> /img/themes/theme2/pic1.jpg >> /...something.../theme1/...some other theme1 related stuff >> ... >> /config/theme1.cfg >> /config/theme2.cfg >> >> (and for some reasons it must stay this way) >> >> -- >> Ashes to ashes, DOS to DOS >> ivoras @ fer.hr >> >> -- >> 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 (#4122) next »