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
- Go to the
Plugins
section in the October CMS backend. - Search for
DeviceDetect
and click theInstall
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
-
This plugin has not been reviewed yet.
-
1.0.1 |
First version of DeviceDetect Oct 06, 2024 |
---|