Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Classing People Pages
I'm working with a heavily modified Vanilla theme, in order to integrate it with an existing site. The theme currently has a problem in IE that only effects the people pages. I know how to fix the problem; the issue is in how the CSS fix should be deployed.
I have a stylesheet that's included using conditional comments specifically for IE hacks; normally I'd just plop the CSS fix in there and go. But since this problem is only on the people pages, I need something specific to them so that the fix doesn't skew the pages that are displaying correctly. Consequently there are two ways around this that I've come up with:
1) Have a people-ie.css that only loads on the People pages. Presumably would mean hacking the $StyleSheet array.
2) Figure out some way to have the <body> class set to "People" on all the People pages. That would allow me to prefix the CSS fix with ".People".
So... did I miss an easy fix? If not, which of the two above would be the easiest/best to implement?
0
This discussion has been closed.
Comments
if ($Context->SelfUrl == "people.php") $Head->AddStyleSheet(/path/to/people-ie.css);
Rather than relying on CSS hacks (which may break as IE 7 rolls out), I usually go Microsoft's recommended route and use conditional comments to expose my IE-only stylesheet to pre-7 IE:
<!--[if lt IE 7]> <link href="/styles/ie.css" rel="stylesheet" type="text/css" media="screen" /> <![endif]-->
If I use the AddStyleSheet, then it seems like I'm forced to rely on CSS hacks to hide my IE-specific CSS from other browsers.
if ($Context->SelfUrl == "people.php") $Head->AddString('<!--[if lt IE 7]><link href="/styles/ie.css" rel="stylesheet" type="text/css" media="screen" /><![endif]-->');
tada...