It can also remove CSS links and Meta tags from the head of the page (like the UnloadCSS skin object). This version is for DotNetNuke 05.06.00+
for DNN below 05.06.00 I would advise ou to upgrade DNN ;-) or use the 02.02.00 version of this skin object.
For DNN 4
use the back ported 02.05.00 release http://stylehelper.codeplex.com/releases/view/88995
This skin object also allows you to set conditions for the adding the file links / meta tags, based on browser, role etc.
These filters can be positive (include) or negative (exclude).
This can all be done from the skin using code too, but this skin object allows you to use these option without any code and from an HTML skin.
Also if you want to add meta tags you don't have to change default.aspx (which is a core hack)
For the current documentation read this: http://www.40fingers.net/Weblogsampnews/Weblogs/tabid/58/articleType/ArticleView/articleId/23/First-Beta-release-of-Style-Helper-Skin-Object.aspxExamples of use
- Remove certain CSS files from the Head
- Load Browser specific CSS / JS files
- Load a culture specific CSS file
- Load a stylesheet specifically for RTL languages
- Add Meta tags, (for the iPhone) to your page.
- Set the doctype
- Detect Mobile browsers
- Redirect to another URL (based on filters)
- Set the skins Doctype
I will add some skin examples in the near future.Please note that due to a change in DNN 6.1, removing Stylesheets works differently
There's a blog post with an explanation here http://www.40fingers.net/WeblogsNews/Weblogs/tabid/58/ID/83/language/en-US/Style-Helper-Skin-object-and-DotNetNuke-61.aspx
All other functionality should work a before as in DNN6.0 and below.Changes:
- Changes to Redirection (mostly used for mobile)
- Add conditions for inject body class (used to inject a class for a role for instance)
- Remove all stylesheets in DNN 6.1+
- Change an existing Meta tag
- You can now also use tokens to add or manipulate Meta tags
- AddHtmlAttribute, now replaces an attribute if it already exists
- Bug fix in Referrer handling
- Improved Redirect Handling
- Get Backlink to the Page that casued the redirect
- Add anything to the Head of the DotNetNuke page
- Remove Existing DotNetNuke MetaTags
Fixed bug in Mobile detection
DNN 5 only release
- Set the Doctype of a skin: Doctype="XHTML 1.0 Transitional"
- New Filter: Check if browser is a mobile browser (or not): IfMobile="True/False"
- Redirect to another URL: RedirectTo="/"
- The way the redirect is handled can be set to always, once per session or once (cookie based): RedirectMode="Always/Once/OncePerSession"
- Add Attributes to the HTML element on the page: AddHtmlAttribute="Attribute,Value"
Fixed issue in GetPageOrder (DNN 5 version) for BodyClass attribute bugs.
Some minor BodyClass attribute bugs.
Add Meta tag is now pipe separated "|" as a meta tag can contain commas.
You can now add a class to the body that shows the which roles with view rights for the current page, the current user is a member of.
Now supports hosted CSS and JS files with AddCssFile & AddJsFile
RemoveCssFile="/" is now internally replaced by "/.*" to make it a valid regex.
Control panel CSS files can be removed now.
- You can now use spaces after the comma in you RemoveCssFile attribute.
(Example: "default.css, portal.css" )
- AddBodyClass attribute allows for the injection of a CSS class to the body of the page.
This can be a static text or a dynamic string based on the Page Name, Page Id and Page Order.
- FilterRemove defaults to True now
- Fixed bug where !Administrators for IfRole was not working correctly