Re: Extra stylesheets for different pages

From: Date: Sun, 23 Dec 2001 17:00:15 +0000
Subject: Re: Extra stylesheets for different pages
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-2380@lists.php.net to get a copy of this message
If the stylesheet info is not dynamic, put them in separate files and include them like so: <style src="/path/to/mystyle.css"> </style> This way the browser can cache the stylesheet info on the first page. If you have dynamic stylesheets, you could still include them statically with a bit of programming trickery, or just put them in the templates like you are doing here. One way is to create stylesheet templates (css.tpl) and include them in the header template. Peter Bowyer wrote: > Hi, > > How do other people handle having extra stylesheets/javascript for > different parts of their site while using Smarty? The only way I can think > of is either to make separate header files, which I don't want to do, or to > create a custom function such as: > {header type=stylesheet link=article.css} > {header type=javascript link=script.js) > and put this in my page templates. The function is then processed, and > assigns anything it generates to a {$header} variable in the header file. > > I'm just worried that this is more overhead, which may be avoidable? > > TIA, > Peter. > > --oOo-- > Narrow Gauge on the web - photos, directory and forums! > http://www.narrow-gauge.co.uk > --oOo-- > Peter's web page - Scottish narrow gauge in 009 > http://members.aol.com/reywob/ > --oOo-- > > --- > 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/

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