Conditional Comments in Page Template

Topics: General, Troubleshooting, XSLT
Mar 24, 2011 at 12:06 AM

In order to support HTML5 in IE8 and below, I have a conditional comment in my App_Data/PageTemplates/GeneralLayout.xml like so:

 

<!--[if lte IE 8]><script src="~/frontend/scripts/html5.js" type="text/javascript"></script><![endif]-->

As this doesn't get rendered by C1, I was wondering how I can include this conditional statement so that it renders?

 

Coordinator
Mar 24, 2011 at 1:27 AM

I just tried this on both our 2.0 SP1 and 2.1 releases and I do not experience this problem - viewing the page source of the generated page shows the conditional comment just fine and as defined in the template.

If this is an issue in Composite C1 there must be more to it - could you post a complete template sample showing this problem?

Mar 24, 2011 at 11:47 AM

shouldnt it be

<!--[if lt IE 9]>

you are basically saying lower than ie8, which means that ie8 itself is not considered.

Mar 24, 2011 at 12:55 PM

ah, i overlooked the e in there, is always just using the lt operator myself

Coordinator
Mar 24, 2011 at 1:54 PM

@tvn @atomiton If I am reading comments right your experience is that Composite C1 emit the markup as you wrote it, but IE is not reacting to it.

Personally I would save the source to a local file and work with it, until IE bites, then see if the required changes migrate well to Composite C1. If Composite C1 is somehow responsible for this please post a bug report on it with a sampl.

I don't know if this is relevant but http://www.quirksmode.org/css/condcom.html says "if you use multiple Explorers on one computer, the conditional comments will render as if all these Explorer versions are the highest Explorer version".