We just released version 02.06.03 of our StyleHelper skin object for DotNetNuke 5.3+ on codeplex.
This is final release after some beta releases following version 02.05.00.
This release includes some additions, changes and bug fixes:
Added Simple Content Injection:
Changes to Redirect:
If you upgrade to this version and have used redirecting in your existing skins, make sure to test them!
Intro: Redirect Logic changes
The way redirect were handled in a previous version was quite basic.
I mostly used it to redirect Mobile devices from the Home page of a regular website to a mobile site
I came a cross a more complex problem for a client were certain page should be redirected to the matching mobile pages.
To support that I restructured Redirecting and when to stop redirecting.
New attribute: RedirectName
You can give a redirect a name, to separate several redirects used on one site.
2 redirect with a different name will not influence each other
This way you can for instance have a Mobile redirect and a redirect for Internet Explorer 6 in the same skin.
It also allows you to share the same redirect over different skins using the same RedirectName.
New Attribute: RedirectBaseUrl
You can use this as a base for redirecting.
If set this will be combined with the RedirectUrl to the Url to redirect to.
You can use the RedirectBaseUrl in the RedirectStop to stop redirecting if you link back from any page on the redirect site.
New Attribute: RedirectStop
With this attribute you set how you on what conditions the redirect is refused
If the redirect is refused, it depends on the RedirectMode attribute what happens the next time the user visits the site.
- Revisit = Will NOT redirect after the first redirect
- RedirectUrl = Will not redirect if the Referrer URL is the Redirect URL
- BaseRedirectUrl = Will not redirect if the Referrer URL contains the Base Redirect URL
- QueryString = Will not redirect if the following Query String Parameter is passed: NoRedirect=True
These values can be combined, comma separated.
Default Value: "RedirectUrl,QueryString"
Relationships with RedirectMode
With "RedirectStop" you set on what conditions redirect should NOT take place.
With "RedirectMode" you set what should happen after a redirect did not take place.
IfMobile="True" RedirectTo="m.site.com" RedirectMode="Session"
Will redirect the first visit of every session.
During this session redirecting will stop (because of the default value)when you:
- Visit the page from the Redirected page.
- If you add the following querystring parameter to the URL.
IfMobile="True" RedirectTo="m.site.com" RedirectMode="Once" RedirectStop="Revisit"
Will redirect the first visit to this page of every session.
During this session redirecting will stop as soons as you revisit the page.
The result is that redirect will only happen once during this session.
IfMobile="True" RedirectTo="m.site.com" RedirectMode="Always" RedirectStop="Never"
Will always redirect the visitor to the mobile site. Visitng the regular site with a mobile device is impossible this way.
Changed Attribute: RedirectMode
You can now use: Always, Once, Session & Never
Never; was added as a way to not remove the the skin object, but switch the rediect off for testing purposes.
Session is the new default value, this used to be "Once". This was changed because session is the most common scenario.
Changes to detectmobilebrowser detection:
Added attribute DetectMobileRegex1
You can use this attribute to overwrite the first regex used by the detectmobilebrowser.com method
Added attribute DetectMobileRegex2
You can use this attribute to overwrite the second regex used by the detectmobilebrowser.com method
Added Attribute: DetectMobileIncludeTablet
On detectmobilebrowser.com/about there's a method to include tablets as mobile devices (by changing the first regex).
If you set DetectMobileIncludeTablet to True, the first regex is replaced and Tablets are treated as mobile (although I'm not 100% sure this is up to date).
Changes to Body Class
- Added attribute: FilterBodyClass
By default the bodyclass ignores the filters you use.
It if you set this attribute to True, the body class is only added if the filter conditions are met.
Changed IfQs behavior:
Bug in AddHtmlAttributes in DNN 6
- The code to insert attributes to the HTML element changed in DNN 6 and did not work any more. This has been corrected now.
Fixed bug in DNN5 Stylesheet removal: