Re: configfiles for language and CSS

From: Date: Wed, 09 May 2001 13:22:33 +0000
Subject: Re: configfiles for language and CSS
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-706@lists.php.net to get a copy of this message
Tomas Sanchez Romani wrote: > > Hi! > > I'm starting o get used to smarty and therefor I have grown a lazyness for > writing things twice and remembering exactly in what places I wrote > something, since I just need to write it once now. > > I wonder two things. > > a) is smarty-configfiles a good place to put multiple-language-support, or > do you have any better ideas for that. > > b) I'm building an application whit extensive use of CSS, this is good since > I just need to change the style-attributes in one place. What I would like > to accomplish is to be able to define > > "MainColor: #663300;" and then use it in the CSS-file as such: > > A { > text-decoration: none; > color: MainColor; > } > > H1 { > display: block; > font-size: 12px; > color: MainColor; > } Here is what I've done in the past. I put the values in the config file like you have here, then create a separate template for the CSS code, and then in that template I escape the braces like so: {config_load file="css.conf"} A {ldelim} text-decoration: {#textDecoration#}; color: {#mainColor#}; {rdelim} > > Thus, when I decide to change the colors of the site I just have to do it in > one place! > > This would, in my opinion, be so great. > > Thanks, tomas > > --- > You are currently subscribed to smarty as: monte@ispi.net > To unsubscribe send a blank email to $subst('Email.Unsub') > Visit Smarty's homepage at > http://www.phpinsider.com/php/code/Smarty/ -- Monte Ohrt <monte@ispi.net> http://www.ispi.net/

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