Project

General

Profile

Actions

Feature #17640

closed

new Feature for BrowserCondition

Added by Steffen Kamper over 16 years ago. Updated about 16 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Communication
Target version:
-
Start date:
2007-10-01
Due date:
% Done:

0%

Estimated time:
PHP Version:
5.2
Tags:
Complexity:
Sprint Focus:

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

csscondition.diff (2.26 KB) csscondition.diff Administrator Admin, 2007-10-01 00:14
ieCondition.diff (2.25 KB) ieCondition.diff Administrator Admin, 2007-10-04 17:17
20071030_iecondition.patch (2.33 KB) 20071030_iecondition.patch Administrator Admin, 2007-10-30 12:28
Actions #1

Updated by Ben van 't Ende over 16 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.

Actions #2

Updated by Steffen Kamper over 16 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 :-) )

Actions #3

Updated by Ben van 't Ende over 16 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.

Actions #4

Updated by Steffen Kamper over 16 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 ;-)

Actions #5

Updated by Patric Pesch over 16 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 :-)

Actions #6

Updated by Steffen Kamper over 16 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

Actions #7

Updated by Benni Mack over 16 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?

Actions #8

Updated by Steffen Kamper over 16 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.

Actions #9

Updated by Steffen Kamper over 16 years ago

ok,. seems to be typo:

$GLOBALS['TSFE']->content .= (you missed the point)

Actions #10

Updated by Benni Mack over 16 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.

Actions #11

Updated by Steffen Kamper over 16 years ago

after manual correction the patch works ;)

Actions #12

Updated by Benni Mack over 16 years ago

Steffen, thanks a lot!

Actions #13

Updated by Benni Mack over 16 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.

Actions

Also available in: Atom PDF