Author:
Makenosound
Version:
1.2
Released:
29 August 2011
Category:
Other

Description

This extension detects mobile clients, what device they are using and lets you redirect users on mobile devices.

It provides a "Mobile Device Detection" datasource for detecting mobile devices based on user-agent string. Its output takes the following form:

<device is-mobile="no" />

If a mobile device is detected the mobile attribute will be set to "yes" and an element will be added the device being used to view the page:

<device is-mobile="yes">
    <android version="2.3" />
</device>

It is theoretically possible for more than one device to appear in this list.

Redirects

You can redirect mobile devices of your choice to a custom mobile site, this can disabled by a visitor by adding ?not-mobile to the current page URL. This sets a cookie and prevents any further attempts to redirect the client.

All configuration is managed from System > Preferences:

No Redirect Cookie
+-----------------------------------+
| no-mobile-redirect                |
+-----------------------------------+

Redirect URL
+-----------------------------------+
| ...                               |
+-----------------------------------+

Redirect Devices
+-----------------------------------+
| ...                               |
+-----------------------------------+
android blackberry ipad iphone palm

If the URL is set, but no devices are selected, then any mobile visitor will be redirected.

Delegates

This extension exposes the MobileRedirection delegate, which allows other extensions to override when and where a mobile device is redirected.

(
    'MobileRedirection',
    '/frontend/',
    array(
        'url'       => &$url,
        'devices'   => &$devices,
        'result'    => $result
    )
)

Changelog

Version 1.2, 29 August 2011

  • PHP 5.2 compatibility from Rowan

Version 1.1, 15 December 2010

  • Re-wrote Max Wheeler's original extension.
  • Added support for more devices, iPad and Android.
  • Added mobile device redirection support.
  • Added support for disabling mobile redirection.

Version 1.0, 5 February 2010

  • Initial release

Repository

https://github.com/makenosound/mobiledevicedetection

Discuss this Extension

Compatibility

2.7.10 Unsure
2.7.9 Unsure
2.7.8 Unsure
2.7.7 Unsure
2.7.6 Unsure
2.7.5 Unsure
2.7.4 Unsure
2.7.3 Unsure
2.7.2 Unsure
2.7.1 Unsure
2.7.0 Unsure
2.6.11 Unsure
2.6.10 Unsure
2.6.9 Unsure
2.6.8 Unsure
2.6.7 Unsure
2.6.6 Unsure
2.6.5 Unsure
2.6.4 Unsure
2.5.4 Unsure

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details