Search

Hi,

How can I put a conditional stylesheet to my XSLT template? Is it possible?

<!--[if lt IE 7]>
    <link rel="stylesheet" type="text/css" href="{$workspace}/css/ie6.css">
<![endif]-->

Thanks a lot.

There is a “manual mode” as well: Simply put s.th. like th following in your master template:

<xsl:comment><![CDATA[[if IE 6]><link rel="stylesheet" type="text/css" href="]]><xsl:value-of select="$root"/><![CDATA[/workspace/assets/css/ie6patches-1.0.css" media="screen" /><![endif]]]></xsl:comment>

I didn’t think you can add ]]><xsl:value-of select="$root"/><![CDATA[ in the middle. That works? Interesting.

Sure! Works like hell. Took me about to one day to figure it out… The main idea is: Start and terminate your CDATA sections properly.

Works fine!

Thanks!

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details