Twig Mobiledetect
by Kevin Johnson


Description

Adds bes89/mobiledetect-twig-extension for detecting mobile devices using Twig. For example you can use:

{% if is_mobile() %} ... {% endif %}
{% if is_tablet() %} ... {% endif %}

Or render a different template on mobile:
{% extends is_mobile() ? "layout_mobile.html.twig" : "layout.html.twig" %}

See the README file for installation instructions.

See: https://github.com/bes89/mobiledetect-twig-extension for documentation on using the library.

To view all the available devices, for example, add {{ get_available_devices()|join("<br/>")|raw }} to one of your theme files.


More Info

Created
13th Jun 2017
Latest Version(s)
Last Update
  • 19th June 2017 (Release)
  • 19th June 2017 (Development)
Category
Plugin
License
MIT

Changelog & Releases

Loading releases …

Related