Page 1 of 1
Conditional Comments
Posted: Thu Jan 29, 2009 7:11 pm
by SideshowBob
Do you need to target specific IE browsers using conditional comments?
Here's an example for Internet Explorer 6 but you could use the same technique for other conditional comments.
Create a stylesheet called IE6 but don't link it to any templates. Then put in all those little tweaks that you want, now insert the below code just above the closing head tag into your template(s):
Code: Select all
<!--[if IE 6]>
{stylesheet name='IE6'}
<![endif]-->
And that's it.
Bob
Re: Conditional Comments
Posted: Thu Jan 29, 2009 7:20 pm
by duclet
No need for this. Use this instead is better since it allows you to target more than just IE.
http://forum.cmsmadesimple.org/index.ph ... 827.0.html
Re: Conditional Comments
Posted: Thu Jan 29, 2009 7:50 pm
by JeremyBASS
@SideshowBob
you may want to read this ... mostly the part about "IE6 and other" conditional commenting...
IE 7 IE 8 FF
http://blog.corbensproducts.com/Blogs/3 ... ments.html
hope this helps

jeremyBass
PS this is not a CMSMS tip or trick

Re: Conditional Comments
Posted: Thu Jan 29, 2009 8:59 pm
by SideshowBob
Thanks Duclet, I actually used your method originally (which is really cool) but some of the css I used caused my page not to validate hence the move to conditional comments.
Jeremy: Thanks for the link, I am aware of the more advanced stuff you can do with conditional comments but that's a good summary.
I'm sorry if you didn't like my tip (or even consider it a tip), I searched the forum and found others asking about conditional comments and I didn't see my solution presented, hence the post.
Bob
Re: Conditional Comments
Posted: Thu Jan 29, 2009 11:17 pm
by JeremyBASS
Oh I don't think it's a bad tip.. I was just saying it's not a CMSMS trick per-say... and What I was meaning by
IE 7 IE 8 FF
is that targets for not IE6 but includes none IE browsers.... I said that as I normal use both when I filter... but it's not commonly known... just My2Cents
cheers
jeremyBass
Re: Conditional Comments
Posted: Fri Jan 30, 2009 2:26 pm
by duclet
What didn't validate?
Re: Conditional Comments
Posted: Fri Jan 30, 2009 3:33 pm
by SideshowBob
I'm using background-position-y to help beat IE6 into submission. There's probably another way to do if I could have been bothered to look a little more.
I quite like the idea of conditional comments as they avoid loading extra css that are only needed as IE fixes.
Bob
Re: Conditional Comments
Posted: Sat Apr 04, 2009 2:59 am
by smirkingdude
I like IE conditional comment...useful when one module (for example: Album module) has an option that links to one CSS file (/modules/Album/css/stylesheet.css) and you want to use a seperate CSS file to focus on IE browser.
Look here...
http://forum.cmsmadesimple.org/index.php/topic,32675.0.html 