DNN websites, modules, skins and support

Menu: Blog ยป Skins and Templates

DotNetNuke Style Helper skin object 02.00.00 released

By:

40Fingers StyleHelper DotNetNuke Skin ObjectToday 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:

New Functionality:

 

Redirect another URL.

Attribute: RedirectTo

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

Example: RedirectTo="/"

  

Persistence of a Redirect.

Attribute: RedirectMode

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".

Modes:

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.

Default: Always

Example: RedirectMode="OncePerSession"
 

Add Attributes to the DNN HTML element

Attribute: AddHtmlAttribute

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.

Example: AddHtmlAttribute="Attribute,Value"

 

Set the Doctype of a DotNetNuke skin

Attribute: doctype

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.

 

New Filter
 

Check for mobile browsers

Attribute: IfMobile="True/False"

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.

Example:
<fortyfingers:STYLEHELPER ID="FFSH1" IfMobile="True" AddCssFile="[S]//Mobile.css" runat="server" />

Will load Mobile.css if the users uses a Mobile browser