Plugin for PyroCMS. A complete reflection of the Codeigniter User Agent Class plus a few extra methods for hiding and showing content on mobile devices.
- Version 1.0
- Compatible with PyroCMS v2.0.x
- Author - Osvaldo Brignoni
- Issue Tracker
- PyroCMS Website
- Codeigniter User Guide - User Agent Class
Hide content from mobile devices.
- match (optional) - The module"s slug.
Example
{{ agent:is_mobile_hide }}
You won't see this on mobile.
{{ /agent:is_mobile_hide }}
Show content on mobile devices only.
- match (optional) - The module"s slug.
Example
{{ agent:is_mobile_show }}
This is only shown on mobile devices.
{{ /agent:is_mobile_show }}
Returns TRUE/FALSE (boolean) if the user agent is a known web browser.
- match (optional) - The module"s slug.
Example
{{ if { agent:is_browser match="Firefox" } }}
Yes, this is Firefox.
{{ else }}
No, this is not Firefox.
{{ endif }}
Returns a string containing the name of the web browser viewing your site.
- none
Example
{{ agent:browser }}
Returns a string containing the version number of the web browser viewing your site.
-
none
{{ agent:version }}
Returns TRUE/FALSE (boolean) if the user agent is a known mobile device.
- none
Example
{{ if { agent:is_mobile } }}
Yes it is.
{{ else }}
No.
{{ endif }}
Returns a string containing the name of the mobile device viewing your site.
- none
Example
{{ agent:mobile }}
Returns TRUE/FALSE (boolean) if the user agent is a known robot.
- none
Example
{{ if { agent:is_robot } }}
Yes it is.
{{ else }}
No.
{{ endif }}
Returns a string containing the name of the robot viewing your site.
- none
Example
{{ agent:robot }}
Returns a string containing the platform viewing your site (Linux, Windows, OS X, etc.).
- none
Example
{{ agent:platform }}
Returns TRUE/FALSE (boolean) if the user agent was referred from another site.
- none
Example
{{ if { agent:is_referral } }}
Yes it is.
{{ else }}
No.
{{ endif }}
Returns a string of the referrer site.
- none
Example
{{ agent:referrer }}
Returns a string containing the full user agent string.
- none
Example
{{ agent:full_string }}
Lets you determine if the user agent accepts a particular language.
- match (optional) - The language code.
Example
{{ agent:accept_language match="en" }}
Lets you determine if the user agent accepts a particular character set.
- match (optional) - The charset name.
Example
{{ agent:accept_charset match="utf-8"}}