HTML 5 Boilerplate, DNN 6

Sep 22, 2011 at 4:28 PM

I really must say, this is one of the best DNN extensions I have found.

I upgraded to DNN 6.00.01 This morning.

Things seem to be working pretty well with Style Helper, but I am having a couple issues setting my document up to act like html 5 boilerplate.

I would like to add modernizer.js after the initial css load. I tried AddAtEnd and AddAtStart, with no luck. I might just be doing it wrong. I ended up adding into the default.aspx file.

I also had trouble getting the doctype to work. I already had the xml file in place, but the skin was reverting to the default doctype. The old xml file was still works if I remove the stylehelper line, so this is minor.

Also, is it possible to add/remove code above the <head>? I would like to add some conditional <html> tags, which would mean I would have to remove the html tag already there. This is what I would like to add:

<!--[if lt IE 7]> <html<%= HtmlAttributeList %> class="no-js ie6 oldie" lang="en"> <![endif]-->
<!--[if IE 7]>    <html<%= HtmlAttributeList %> class="no-js ie7 oldie" lang="en"> <![endif]-->
<!--[if IE 8]>    <html<%= HtmlAttributeList %> class="no-js ie8 oldie" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html<%= HtmlAttributeList %> class="no-js" lang="en"> <!--<![endif]-->





Sep 24, 2011 at 6:54 PM

Hi , thanks for the feedback.

About the JS, I just tested this:

<fortyfingers:STYLEHELPER ID="STYLEHELPER" AddJsFile="Test.js" AddAtEnd="True" runat="server" />

And it adds the JS file just before the end of the head... id this the same you tried?

About the HTML element, you can add attributes to it, but the IE conditions you show are not possible.

This is due to the fact that it's a server control, if I would remove or replace it DNN would crash as it expects the control.

You can do something similar, by letting the skin object inject the classes based on the browser, which would in effect be the same.
(and keeps you HTML cleaner)
You would have to add the skin object multiple time though (which is not really a problem).

<fortyfingers:STYLEHELPER ID="STYLEHELPER1" IfBrowser="IE=6" AddHtmlAttribute="class,no-js ie6 oldie" runat="server" />
<fortyfingers:STYLEHELPER ID="STYLEHELPER2" IfBrowser="IE=7" AddHtmlAttribute="class,no-js ie7 oldie" runat="server" />
<fortyfingers:STYLEHELPER ID="STYLEHELPER3" IfBrowser="IE=8" AddHtmlAttribute="class,no-js ie8 oldie" runat="server" />
<fortyfingers:STYLEHELPER ID="STYLEHELPER4" IfBrowser="IE>8" AddHtmlAttribute="class,no-js" runat="server" />

I hope that helps




Sep 24, 2011 at 6:55 PM

Oh, I forgot, could you post what you tried to set the doctype?

Thanks, Timo