817

Product support

Get help in the plugin support forum.

  • Added on Oct 20, 2024
  • Current version: 1.0.1
  • Platform Compatibility
    v3.x use latest
    v2.x incompatible
    v1.x incompatible
  • Created by

Categories

DeviceDetect Plugin for October CMS

This plugin implements global variables: isMobile, isTablet, isDesktop for twig templates. Plugin based on the Mobile-Detect php class: https://github.com/serbanghita/Mobile-Detect

Installation

  1. Go to the Plugins section in the October CMS backend.
  2. Search for DeviceDetect and click the Install button.

or

php artisan plugin:install Settler.DeviceDetect

Usage

You can use the following variables in your Twig templates:

  • isMobile: true if the device is a mobile phone, false otherwise.
  • isTablet: true if the device is a tablet, false otherwise.
  • isDesktop: true if the device is a desktop computer, false otherwise.

Example:

{% if isMobile %}
    <p>This is displayed on mobile devices.</p>
{% elseif isDesktop %}
    <p>This is displayed on desktop devices.</p>
{% endif %}

All docs in the details page

1.0.1

First version of DeviceDetect

Oct 06, 2024