Feature #17640
closed
new Feature for BrowserCondition
Added by Steffen Kamper about 17 years ago.
Updated over 16 years ago.
Description
this is a tiny feature but IMHO very useful. It allows you to use Browser Conditions for CSS-including.
The syntax is:
page.includeCSS.file1 = fileadmin/style.css
page.includeCSS.file1.browserCondition = IE 7
the output looks like
patch is included.
(issue imported from #M6421)
Files
I would call it "ieCondition" as it only applies to IE. I think I like your solution ;-) It is almost necessary for evry site you build.
hi Ben,
it's also possible to use this condition
<!--[if opera]>
so a general naming is ok.
Hope that helps a lot of us, you're right, it's really needed in every site
(Why? ask in Redmond :-) )
What? Can you give me some examples of that. In my experience we do not need any specific styling for all the other browsers than ie.
This was an result of google research of that conditions.
I never used that condition, but evry site of mine has a special ie.css loaded with a condition.
So you are right that it is used 99.99% for IE.
But the naming is no problem, we can rename that to ieCondition as well, I only want to have this feature build in to use it ;-)
As far as i know, the additional comments are MSIE only (http://msdn2.microsoft.com/en-us/library/ms537512.aspx)
i don't think that other browsers supports this feature and <!--[if opera]> does not work for me (respectively my Opera).
##edit##
Thanks for the patch - its a nice feature :-)
here is additional text for the TSref documentation, description in includeCSS
.ieCondition - set a condition for IE. In this case the inclusion is done with a CSS Condition.
Example: file1.ieCondition = IE7
will output
I hope that the text is ok. I also upload a patch with renaming
browserCondition => ieCondition
Hey guys,
just had a quick look at the pach.
I did not like the style much, that's why I changed some lines and also increased readability. I haven't tested it though, could anybody try out the patch before I'm gonna send it to the core list?
Hi Bennie,
there is something wrong with your patch, whole header is stripped (page starts with <![endif]>)
i will look at the source in the afternoon.
ok,. seems to be typo:
$GLOBALS['TSFE']->content .= (you missed the point)
yup. thought so too after reading your first post.
I forgot it in the first part as well...
I'm uploading a new version now.
after manual correction the patch works ;)
Seems like the core team does not want more IE specific code in the Core. If you don't agree with it, please answer to the thread in the core list with very good reasons, then I will open up this issue again.
Also available in: Atom
PDF