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
Smarty Variables in a stylesheet - Browser Sniff
Re: Smarty Variables in a stylesheet - Browser Sniff
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
still the best option is to try create css that works in every browser 
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" />
}

Re: Smarty Variables in a stylesheet - Browser Sniff
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.