Ability to add ID or CLASS to <link> tag inserted by AddCssFile

Oct 21, 2012 at 3:40 AM

I would like to have the ability to add ID or CLASS to <link> tag inserted by the StyleHelper AddCssFile skin object attribute.

For example, I would like to do the following:

<dnn:STYLEHELPER AddCssFile="css/largest.css" id="textsize" runat="server" />

But id="idname" or class="classname" gets removed.

According to the w3c, class and id's are allowed in link tags:

http://www.w3.org/TR/html4/struct/links.html#h-12.3

I have tried using:

<dnn:STYLEHELPER Content="<link id='textsize' href=/dnn_dev/Portals/_default/Skins/H2O/css/largest.css' media='screen' type='text/css' rel='stylesheet'></link>" runat="server" />

But this does not work because the content is place outside of the head tag, and link tags are not respected or recognized outside of the head tag. This is confirmed as well on the w3c website:

http://www.w3.org/TR/html4/struct/links.html#h-12.3

Can we have this added to the core ability of StyleHelper?

Coordinator
Oct 21, 2012 at 8:39 AM

Thanks for you feedback.

It's possible already, you just used the wrong attribute.

I added the AddToHead attribute for these kind of scenarios.

Example:

<dnn:STYLEHELPER AddToHead="<link id='textsize' href=/dnn_dev/Portals/_default/Skins/H2O/css/largest.css' media='screen' type='text/css' rel='stylesheet'></link>" runat="server" />

HTH

Timo