Smarty Variables in a stylesheet - Browser Sniff

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Locked
MikePearce

Smarty Variables in a stylesheet - Browser Sniff

Post by MikePearce »

Hi all,

Sorry if this has been answered before, I have searched but couldn't find an answer.

Is it possible to use smarty variables/functions in a stylesheet?

Alternatively, is there a way I can show different browsers different stylesheets? Or just slightly modified stylesheets?

Cheers,

Mike
tsw
Power Poster
Power Poster
Posts: 1408
Joined: Tue Dec 13, 2005 10:50 pm

Re: Smarty Variables in a stylesheet - Browser Sniff

Post by tsw »

You can use css hacks to have different rules for IE like holly hack

http://www.communitymx.com/content/arti ... &cid=C37E0

or conditional comments

http://www.quirksmode.org/css/condcom.html

or you can create new stylesheet and not assosiate it with your template and create used defined tag to check browser

Code: Select all

if(isset($_SERVER['HTTP_USER_AGENT']) && preg_match('/MSIE/', $_SERVER['HTTP_USER_AGENT']))
{
echo "<link rel="stylesheet" type="text/css" href="/stylesheet.php?name=yourstylesheetname" />
}
still the best option is to try create css that works in every browser ;)
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: Smarty Variables in a stylesheet - Browser Sniff

Post by Ted »

As far as smarty variables on stylesheets, currently no.  None of that stuff is run through smarty because of the nasty issues that would come from the { } stuff.
Locked

Return to “Layout and Design (CSS & HTML)”