About mdetect
MODx Revolution 2.2+ Snippet to detect different mobile phone and tablet devices based on mobileesp. Keep in mind that mdetect only works when cache is disabled.
Author: Alexander Herling [email protected]
Web Site: http://www.degoya.de
Based on mobileespProject Owner: Anthony Hand
Web Site: http://www.mobileesp.com
Descriptions have been taken from http://www.hand-interactive.com/detect/mobileespdemophp.htm
Information
Released
April 21, 2014
Supported Database
License
GPLv2
Supported Versions
2.2 - <2.3
Downloads
944
Instructions
Install the Package via MODx Package-Manager.
To check if the Snippet works correct just apply the mdetect template to a resource and view the resource in your phone/tablet browser.
Just view the mdetect template to see the usage sample with all options.
OPTIONS
global - (Opt) don't combine with other options is - (Opt) check Quick Variables detect - (Opt) Use detect options output - (Str) The value returned if true (if not set 1 will be returned) outputfalse - (Str) The value returned if false (if not set 0 will be returned)
OPTION VALUES
global
GetUserAgent GetHttpAccept
is
Android AndroidPhone Webkit MobilePhone TierTablet TierIphone TierRichCss TierGenericMobile
detect
TierTablet TierIphone TierRichCss TierOtherPhones MobileQuick MobileLong Smartphone IphoneOrIpod Iphone Ipod Ipad Ios Android AndroidPhone AndroidTablet AndroidWebKit GoogleTV WindowsPhone WindowsPhone7 WindowsPhone8 WindowsMobile BlackBerry BlackBerry10Phone BlackBerryWebKit BlackBerryTablet BlackBerryTouch BlackBerryHigh BlackBerryLow S60OssBrowser SymbianOS PalmWebOS WebOSTablet PalmOS Kindle Tizen Bada Meego MaemoTablet DangerHiptop GarminNuvifone SonyMylo Archos Webkit OperaMobile OperaAndroidPhone OperaAndroidTablet GameConsole GamingHandheld Xbox Nintendo SonyPlaystation BrewDevice WapWml MidpCapable
USAGE
OUTPUT DATAS:
User-Agent: [[!mdetect?global=GetUserAgent
]]
GetHttpAccept: [[!mdetect?global=GetHttpAccept
]]
Check Quick Variables (returns 1 if true and 0 if false):
Android: [[!mdetect?is=Android
]]
Detect and SET OUTPUT (returns output value on true and outputfalse value on false)
[[!mdetect?detect=AndroidTablet
&output=AndroidTablet.css
]]
SET OUTPUT (returns output value on true and nothing on false)
[[!mdetect?is=TierTablet
&output=tablet.css
]]
SET OUTPUT (returns output value on true and outputfalse value on false)
[[!mdetect?is=TierTablet
&output=tablet.css
&outputfalse=nontablet.css
]]
New in 1.0.0-pl
Initial content