Feature #17640
closednew Feature for BrowserCondition
0%
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
Updated by Ben van 't Ende about 17 years ago
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.
Updated by Steffen Kamper about 17 years ago
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 :-) )
Updated by Ben van 't Ende about 17 years ago
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.
Updated by Steffen Kamper about 17 years ago
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 ;-)
Updated by Patric Pesch about 17 years ago
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 :-)
Updated by Steffen Kamper about 17 years ago
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
Updated by Benni Mack about 17 years ago
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?
Updated by Steffen Kamper about 17 years ago
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.
Updated by Steffen Kamper about 17 years ago
ok,. seems to be typo:
$GLOBALS['TSFE']->content .= (you missed the point)
Updated by Benni Mack about 17 years ago
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.
Updated by Steffen Kamper about 17 years ago
after manual correction the patch works ;)
Updated by Benni Mack about 17 years ago
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.