voyent
Conditional Comments in ICEFaces 1.7.0-DR1  XML
Forum Index -> Development Build Feedback
Author Message
Timbo

Joined: 20/Jul/2007 00:00:00
Messages: 33
Offline


In our project in the main site, we have the following for adding css for IE6 and IE7 to the page inside the <head> tag.

Code:
	
 <f:verbatim>
 	<!--[if lte IE 7]>
 		<link href='index_ie7.css' rel='stylesheet' type='text/css' />
 	<![endif]-->
 	<!--[if lte IE 6]>
 		<link href='index_ie6.css' rel='stylesheet' type='text/css' />
 	<![endif]-->
 </f:verbatim>
 


This worked fine until version 1.6.0 ... but now when using ICEfaces 1.7.0-DR1 after partial submits of the page the head is reloaded and all links (and so the CSS styles) are gone. This also happens with an empty <f:verbatim> tag. Is this already a known problem with 1.7.0-DR1 or is there another workaround for including conditional comments and so different CSS-files for the different IE-versions?

thx,
Timbo
mark.collette


Joined: 07/Feb/2005 00:00:00
Messages: 1692
Offline


<f:verbatim>
<!--[if lte IE 7]>
<link href='index_ie7.css' rel='stylesheet' type='text/css' />
<![endif]-->
<!--[if lte IE 6]>
<link href='index_ie6.css' rel='stylesheet' type='text/css' />
<![endif]-->
</f:verbatim> 


There's an easier approach that you can use, which employs the ice:outputStyle component:

<ice:outputStyle href="index.css" />

Then have three CSS files:
  • index.css : Common classes
  • index_ie.css : IE 6 and lower specific classes
  • index_ie7.css : IE 7 specific classes
  • [Email]
    Timbo

    Joined: 20/Jul/2007 00:00:00
    Messages: 33
    Offline


    Wow, thank you very much!

    This is way easier ... i must have overlooked the <ice:outputStyle>-tag.
     
    Forum Index -> Development Build Feedback
    Go to:   
    Powered by JForum 2.1.7ice © JForum Team