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
Pluginssection in the October CMS backend. - Search for
DeviceDetectand click theInstallbutton.
or
php artisan plugin:install Settler.DeviceDetect
Usage
You can use the following variables in your Twig templates:
isMobile:trueif the device is a mobile phone,falseotherwise.isTablet:trueif the device is a tablet,falseotherwise.isDesktop:trueif the device is a desktop computer,falseotherwise.
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 |
|---|