GithubHelp home page GithubHelp logo

pyrocms-agent-plugin's Introduction

USER AGENT PLUGIN

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.


USAGE

IS MOBILE HIDE

Hide content from mobile devices.

Arguments

  • match (optional) - The module"s slug.

Example

{{ agent:is_mobile_hide }}  

    You won't see this on mobile.

{{ /agent:is_mobile_hide }}

IS MOBILE SHOW

Show content on mobile devices only.

Arguments

  • match (optional) - The module"s slug.

Example

{{ agent:is_mobile_show }}

    This is only shown on mobile devices.

{{ /agent:is_mobile_show }}

IS BROWSER

Returns TRUE/FALSE (boolean) if the user agent is a known web browser.

Arguments

  • match (optional) - The module"s slug.

Example

{{ if { agent:is_browser match="Firefox" } }}

    Yes, this is Firefox.
    
{{ else }}

    No, this is not Firefox.

{{ endif }}

BROWSER

Returns a string containing the name of the web browser viewing your site.

Arguments

  • none

Example

{{ agent:browser }}

VERSION

Returns a string containing the version number of the web browser viewing your site.

Arguments

  • none

    {{ agent:version }}


IS MOBILE

Returns TRUE/FALSE (boolean) if the user agent is a known mobile device.

Arguments

  • none

Example

{{ if { agent:is_mobile } }}

    Yes it is.

{{ else }}

    No.

{{ endif }}

MOBILE

Returns a string containing the name of the mobile device viewing your site.

Arguments

  • none

Example

{{ agent:mobile }}

IS ROBOT

Returns TRUE/FALSE (boolean) if the user agent is a known robot.

Arguments

  • none

Example

{{ if { agent:is_robot } }}

    Yes it is.

{{ else }}

    No.

{{ endif }}

ROBOT

Returns a string containing the name of the robot viewing your site.

Arguments

  • none

Example

{{ agent:robot }}

PLATFORM

Returns a string containing the platform viewing your site (Linux, Windows, OS X, etc.).

Arguments

  • none

Example

{{ agent:platform }}

IS REFERRAL

Returns TRUE/FALSE (boolean) if the user agent was referred from another site.

Arguments

  • none

Example

{{ if { agent:is_referral } }}

    Yes it is.

{{ else }}

    No.

{{ endif }}

REFERRER

Returns a string of the referrer site.

Arguments

  • none

Example

{{ agent:referrer }}

FULL STRING

Returns a string containing the full user agent string.

Arguments

  • none

Example

{{ agent:full_string }}

ACCEPT LANGUAGE

Lets you determine if the user agent accepts a particular language.

Arguments

  • match (optional) - The language code.

Example

{{ agent:accept_language match="en" }}

ACCEPT CHARSET

Lets you determine if the user agent accepts a particular character set.

Arguments

  • match (optional) - The charset name.

Example

{{ agent:accept_charset match="utf-8"}}

pyrocms-agent-plugin's People

Contributors

brignoni avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.