Author:
DavidOliver
Version:
1.0.1
Released:
4 April 2012
Category:
Other

Browse

Description

Status

This extension is deprecated as Categorizr is no longer being developed/maintained.

Brett Jankord:

About a year ago I had this crazy idea to apply mobile first thinking to device detection. Yet I’ve awakened from the consensual hallucination that the web can be divided and grouped into simple categories like mobile, tablet, and desktop since then.

Introduction

Categorizr was a mobile-first device detection script that helped categorize different web-capable devices into four categories: mobile, tablet, tv and desktop.

Knowing into which category the visitor’s device falls helped in using Responsive Design + Server Side Components (RESS) and Hybrid Responsive Web Design (HRWD) techniques.

Usage

Once installed and enabled, Device Categorizr will ensure all frontend pages have a parameter called device-categorizr added to the parameter pool with one of the following values:

  • mobile
  • tablet
  • tv
  • desktop

You are then able to change your XSLT templates’ output based on your visitor’s device type.

Examples

CSS, JavaScript, image sizes and HTML source order are all examples of things you may wish to alter based on your visitor’s device type.

Image-sizing via JIT

<xsl:choose>
    <xsl:when test="$device-categorizr='desktop'">
        <img src="{$root}/image/1/1000/0/{image/@path}/{image/filename}"/>
    </xsl:when>
    <xsl:when test="$device-categorizr='tv' or $device-categorizr='tablet'">
        <img src="{$root}/image/1/800/0/{image/@path}/{image/filename}"/>
    </xsl:when>
    <xsl:otherwise>
        <img src="{$root}/image/1/500/0/{image/@path}/{image/filename}"/>
    </xsl:otherwise>
</xsl:choose>

Allowing visitors the option

If necessary, you can also provide links with a view URL query string parameter that enable visitors to manually choose their desired view. For example: http://example.net/?view=desktop This will save the desired view type in the PHP session for subsequent page loads. However, if your website serves the same content to and responds in a suitable way to each type of device, this will likely be superfluous and an unnecessary complication for your visitors.

Credit and thanks

Categorizr was created by Brett Jankord.

Repository

https://github.com/DavidOliver/device_categorizr

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