[thelist] xssi serving up separate css

Adam adam at hallinteractive.com
Fri Oct 12 09:26:33 CDT 2001


Hey all
being really green when it comes to server side stuff I'm hoping one of you
kids can help me out.

I have a problem with a doc that NEEDS 2 sheets one for IE5+/NN6 and another
for NN4. so after much discussion with other list members and other lists it
was determined that using javascript to detect/apply the css accordingly
would be unfair to the 12% of users without js enabled in their
browsers....so in comes xssi as a suggestion...
here's what I've managed with much help....

<!--#if expr="${HTTP_USER_AGENT} = /.*MSIE [456].*/" -->
      <!--#include virtual="stylesmain.css" -->
    <!--#elif expr="${HTTP_USER_AGENT} = /.*Mozilla\/4.*/" -->
      <!--#include virtual="stylesnn.css" -->
    <!--#elif expr="${HTTP_USER_AGENT} = /.*Mozilla\/[56].*/" -->
      <!--#include virtual="stylesmain.css" -->
    <!--#else -->
      <!--#include virtual="basic.css" -->
   <!--#endif -->

now the problem is the virtual include is just including the css in the
parent doc and not applying it to the HTML.
So I tried using the code below to link to the classic css linking format.
like so...

<!-- stylesmain.snip.document -->

<link href="stylesmain.css" rel="styleSheet" type="text/css">

<!-- stylesmain.snip.document -->

and in the parent doc...

<!--#if expr="${HTTP_USER_AGENT} = /.*MSIE [456].*/" -->
      <!--#include virtual="stylesmain.snip" -->
    <!--#elif expr="${HTTP_USER_AGENT} = /.*Mozilla\/4.*/" -->
      <!--#include virtual="stylesnn.snip" -->
    <!--#elif expr="${HTTP_USER_AGENT} = /.*Mozilla\/[56].*/" -->
      <!--#include virtual="stylesmain.snip" -->
    <!--#else -->
      <!--#include virtual="basic.snip" -->
   <!--#endif -->

please for the love of god will someone have pity on me and explain what to
do here? I can't seem to figure it out!
thx all!

cheers





More information about the thelist mailing list