Tablet being recognized as Mobile

Chetan Sharma asked on October 1, 2014 21:14

Hello,

I am using this macro in repeater to select device based transformation like this:-

{% if (CurrentDevice.IsMobile AND !CurrentDevice.UserAgent.contains("ipad") AND !CurrentDevice.UserAgent.contains("tablet") AND GlobalObjects.DocumentTypes["GDI.SliderImage"].Children.Transformations.Exists(CodeName == "home_slider_tabs_mobile")) {"GDI.SliderImage.slider_tabs_mobile"} else {"GDI.SliderImage.slider_tabs"}

%}

However it is recognizing Samasung galaxy tab 2 as Mobile instead of Tablet.

Could anyone guide whats wrong with my code or is it a UA problem?

Thanks Chetan

Recent Answers


Martin Danko answered on November 21, 2014 12:35

Hello Chetan,

The CurrentDevice object holds information about the device detected for the current visitor. The system identifies devices based on their user agent and retrieves the data about the capabilities of devices from the integrated 3rd party component 51degrees.mobi.

Note that most of the properties are only available in the 51degrees.mobi Premium data. By default, Kentico includes the Lite license which you can upgrade. So I'm afraid you will need to but a license for Premium Data if you are willing to use this functionality.

For more details please take a look at the bottom of the following page in the Documentation: Using 51degrees.mobi device data

Best regards, Martin

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.