By: Timo Breumelhof
Today I released a new version of the 40Fingers Style Helper skin object for DotNetNuke..
The main enhancements are for DNN mobile skins / websites.
I made detection of mobile browser much easier and you can now redirect the user to another DotNetNuke page or even website.
This version is DotNetNuke 5+ only, for DNN 4; use the 01.08.04 version.
You can download the new version of this DotNetNuke skin obeject here: http://stylehelper.codeplex.com/
Full documentation here: http://www.40fingers.net/WeblogsNews/Weblogs/tabid/58/ID/23/language/en-US/Style-Helper-Skin-Object-Documentation.aspx
Changes for this version:
Redirect another URL.
Use: This can be used to redirect certain (mostly mobile) browsers to another page or website.
The way the redirect is handled is set with the "RedirectMode" Attribute
Persistence of a Redirect.
Use: You can set the redirect to be active once, once per visit or always.
This is cookie based, a cookie is stored to track if the user is a new visitor or not.
I mainly developed this to redirect mobile browsers to a mobile DotNetNuke page.
If you add a link to the full website on the mobile page, always redirecting mobile would be an issue. In that case you set RedirectMode to "Once" or "OncePerSession".
Always: will always do the redirect
Once: Will redirect once, write a cookie and will not redirect the next time the user visits the site (unless he clears the cookie).
OncePerSession: Will only redirect once during this visit, the next time the user visits the site he will be redirected again.
Add Attributes to the DNN HTML element
Use: This can be used for instance if you want to add support for the Open Graph protocol to a page. In that case you need to add attributes to the DotNetNuke pages HTML element.
Set the Doctype of a DotNetNuke skin
Use: You can now set the doctype of a skin using the Style Helper skin object.
This means you don't need to create any skinname.doctype.xml files.
Values: "HTML 5", "XHTML 1.0 Strict", "XHTML 1.0 Transitional", "XHTML 1.1", "HTML 4.01 Strict"
Example: Doctype="XHTML 1.0 Transitional"
Note: the doctype is always set if you use this, it is not influenced by the filters.
Check for mobile browsers
Use: With this filter you can filter on "Mobile visitors".
It uses this technique to check if the users browser is a mobile browser: http://detectmobilebrowser.com/
If you don't set the attribute, there is no filtering.
You set the attribute to True if you want to filter on Mobile browsers.
You set the attribute to False if you want to filter on NON-Mobile browsers.
<fortyfingers:STYLEHELPER ID="FFSH1" IfMobile="True" AddCssFile="[S]//Mobile.css" runat="server" />
Will load Mobile.css if the users uses a Mobile browser