You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Argo Vilberg <wi...@gmail.com> on 2008/08/05 12:22:48 UTC

Tapestry5 and css in IE6 and IE7

hi,


In my web application are different css for IE6 and IE7.


<link rel="stylesheet" media="screen, projection"
href='${asset:context:css/main.css}' />
<!--[if IE 7]>
<link rel="stylesheet" media="screen, projection"
href='${asset:context:css/ie7.css}'" />
<![endif]-->
<!--[if lte IE 6]>
<link rel="stylesheet" media="screen, projection"
href='${asset:context:css/ie6.css}'" />
<![endif]-->



But IF IE7 and If IE6 are ordinary html comments, thats only browser
understands.


But Tapestry does not.


Becouse of tapestry wants ${asset:context:css/main.css} to include css file,
i have no chance to include ie7.css or ie6.css.




Any ideas?



Argo

Re: Tapestry5 and css in IE6 and IE7

Posted by Argo Vilberg <wi...@gmail.com>.
Ok thanx.

This version works very well!


package ee.softpro.components;

import org.apache.tapestry5.annotations.BeginRender;
import org.apache.tapestry5.annotations.AfterRender;
import org.apache.tapestry5.annotations.Parameter;
import org.apache.tapestry5.MarkupWriter;

public class ConditionalComments {


    @Parameter(required=true,defaultPrefix="literal")
    private String _condition;

    @BeginRender
    private void beginRender(MarkupWriter writer) {
        writer.writeRaw("<!--[if ");
        writer.writeRaw(_condition);
        writer.writeRaw("]>\n");
    }
    @AfterRender
    private void endRender(MarkupWriter writer) {
            writer.writeRaw("<![endif]-->");
    }

}



<t:ConditionalComments condition="IE 7">
   <link rel="stylesheet" media="screen, projection"
href='${asset:context:css/ie7.css}'/>
</t:ConditionalComments>

<t:ConditionalComments condition="lte IE 6">
   <link rel="stylesheet" media="screen, projection"
href='${asset:context:css/ie6.css}'/>



<script type="text/javascript">
$(document).ready(function(){
    $("#container").prepend('<div id="notice">Kasutate aegunud brauserit
(Internet Explorer 6), palun uuendage versioonile 7 vƵi vahetage <a href="
http://www.firefox.com">Mozilla Firefoxi</a> vastu. <span>sulge
[X]</span></div>').css("display", "none").slideDown("10");});


</script>


Argo




2008/8/5 Christian Gorbach <ch...@gmx.at>

> hi,
> search for 'conditional comment' in the list archives..
> the solution is to write a tiny custom component.
> c)hristian
>
>
>  hi,
>>
>>
>> In my web application are different css for IE6 and IE7.
>>
>>
>> <link rel="stylesheet" media="screen, projection"
>> href='${asset:context:css/main.css}' />
>> <!--[if IE 7]>
>> <link rel="stylesheet" media="screen, projection"
>> href='${asset:context:css/ie7.css}'" />
>> <![endif]-->
>> <!--[if lte IE 6]>
>> <link rel="stylesheet" media="screen, projection"
>> href='${asset:context:css/ie6.css}'" />
>> <![endif]-->
>>
>>
>>
>> But IF IE7 and If IE6 are ordinary html comments, thats only browser
>> understands.
>>
>>
>> But Tapestry does not.
>>
>>
>> Becouse of tapestry wants ${asset:context:css/main.css} to include css
>> file,
>> i have no chance to include ie7.css or ie6.css.
>>
>>
>>
>>
>> Any ideas?
>>
>>
>>
>> Argo
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Tapestry5 and css in IE6 and IE7

Posted by Christian Gorbach <ch...@gmx.at>.
hi,
search for 'conditional comment' in the list archives..
the solution is to write a tiny custom component.
c)hristian

> hi,
>
>
> In my web application are different css for IE6 and IE7.
>
>
> <link rel="stylesheet" media="screen, projection"
> href='${asset:context:css/main.css}' />
> <!--[if IE 7]>
> <link rel="stylesheet" media="screen, projection"
> href='${asset:context:css/ie7.css}'" />
> <![endif]-->
> <!--[if lte IE 6]>
> <link rel="stylesheet" media="screen, projection"
> href='${asset:context:css/ie6.css}'" />
> <![endif]-->
>
>
>
> But IF IE7 and If IE6 are ordinary html comments, thats only browser
> understands.
>
>
> But Tapestry does not.
>
>
> Becouse of tapestry wants ${asset:context:css/main.css} to include css file,
> i have no chance to include ie7.css or ie6.css.
>
>
>
>
> Any ideas?
>
>
>
> Argo
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org