Kentico CMS 7.0 Developer's Guide

Enabling mobile development features

Enabling mobile development features

Previous topic Next topic Mail us feedback on this topic!  

Enabling mobile development features

Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic!  

Enabling device profiles

 

Device profiles in Kentico CMS allow you to customize the layout and content of pages according to the specific devices that visitors use to view the pages. To start using device profiles, enable them in the settings first.

 

1. Open Site Manager and navigate to Settings -> Content -> Content management.

 

2. (Optional) Select a site where you want to enable device profiles.

 

3. In the Mobile development section, check the Enable device profiles setting.

 

4. Click Save Save.

 

With device profiles enabled, the system evaluates whether the device that is requesting a page belongs to one of the device profiles defined in Site Manager -> Development -> Device profiles. See Creating device profiles for details.

 

Setting up device detection

 

By default, Kentico CMS only detects a limited set of mobile devices. The basic detection uses XML data stored in the ~/App_Data/CMSModules/DeviceProfile/devices.xml file, which contains information about specific devices.

 

Each device has a set of properties describing its capabilities and a list of user agents used for identification. For example:

 

<Device name="Nokia_710" displayname="Nokia - 710" width="480" height="800" mobile="true">
<UserAgent>
   Mozilla/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0; NOKIA; Lumia 710)
</UserAgent>
<UserAgent>
   Mozilla/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0; NOKIA; 710)
</UserAgent>
</Device>

 

You can manually expand the data by adding devices and their user agents. The system reloads the data every time the application starts, so you need to restart the application for changes to take effect.

 

When creating device profiles, you can assign the devices from the XML file using the device selector.

 

Using 51degrees.mobi device data

 

The 51degrees.mobi mobile device detection software integrated into Kentico CMS allows you to extend the detection data to include all devices that are available on the market. The data also provides access to all device properties (listed in the device macro reference).

 

To use this data, you need to obtain a license from 51degrees.mobi and register it within Kentico CMS.

 

1. Buy a license for Premium Data at 51degrees.mobi. You will receive either a license key that enables you to download device data automatically, or a data file that you need to manually upload into the system.

 

2. Go to Site Manager -> Settings -> Integration -> 51degrees.mobi.

 

3. Enter your 51degrees.mobi license key into the text box and click Activate, or select a data file from your disk and click Upload.

 

4. Click Save Save.

 

The system now has access to the 51degrees.mobi mobile device data set. You can select devices directly from the device selector when creating device profiles and you can access additional device properties within the CurrentDevice object.