How to detect unsupported browsers with DNN Dynamic Roles

DNN Dynamic Roles can be used to detect an unsupported browser and or browser version in the DNN CMS platform. If an unsupported browser is detected, you can show an error message or update hint for example. Here’s how:

First, after having installed DNN Dynamic Roles, create a new dynamic role. Name it “Unsupported Browsers”.

Use the <browser> rule to specify the browsers which you want to handle as unsupported. You can define multiple browsers to be unsupported by using the logical <or> operator. For example, the following rule defines all versions of Internet Explorer <= 8 as well as Opera as unsupported:

<or>
    <browser type="InternetExplorer" maxVersion="8" />
    <browser type="Opera" />
</or>

It is important to set the “Cache Time” option to 0, the “Eval Trigger” to “Request”, and the “Update Method” to “Sync”.

2014-11-12_ScreenshotUnsupportedBrowserDyamicRole

After saving your new dynamic role, you’re ready to use it!

Let’s create the content to be shown if an unsupported browser is detected.

To do this, create a new HTML module and place your desired hint inside. Switch to the HTML module’s settings by clicking the gear icon in the upper right corner of the module. Under “Advanced Settings”, enable “Display module on all pages” so that your hint is shown on all pages.

2014-11-12_ScreenshotAdvancedSettingsDisplayModuleOnAllPages

Go to the “Permissions” tab and restrict the visibility of your hint to the newly created dynamic role “Unsupported Browsers”.

2014-11-12_ScreenshotPermissions

That’s it. All logged in users will see the unsupported browser hint if the rule matches.

 

More information: