The Rule form: Environment

(1 vote, average 5.00 out of 5)

3-cham-environment-form

1-2. Start & End date/time (freeform)

Start & end date, time or both for this rule to be active. If you specify only a date (not time) then the rule will be active from the start of that day. If you enter only a time then that applies every day.

You can specify just a start date/time (in which case the rule will start to SUCCEED from that date/time), just an end date/time (in which case the rule will start to FAIL from that date/time), or both.

Examples:

  • 1 October 2008 09:30
  • October 2 2008
  • 11:15
  • 10:00PM

If you want more precise time span control (e.g. between 22:00 on Tuesday night through to 09:00 Wednesday morning), you should look at the JomGenius inTimeSpan() support. Although this requires some PHP coding, it’s very simple to set up and extremely effective — plenty of examples are given.

e.g. if ( $core_genius->inTimeSpan("tue 22:00 - wed 09:00") ) return true; // SUCCEED between these times

3. Only these languages

Comma-separated list of languages to include for this template. All other languages will be excluded. e.g. en,de,fr. The language(s) may represent the front-end language in Joomla, or the language of the browser — the options for this are set in the Details section.

4. Exclude these languages

Comma-separated list of languages to exclude for this template. All other languages will be included. e.g. en,de,fr. The language(s) may represent the front-end language in Joomla, or the language of the browser — the options for this are set in the Details section.

5. Domain name(s)

Comma-separated list of domain names to include for this template. All other domain names will be excluded.

Domain names must be the full domain name that was used in the web browser to access the site, and not including "http://". example.com is considered to be different from www.example.com.

This feature allows you, for example, to use a series of parked domains for your web site, then template each of the sites differently based on the domain name.

e.g. us.example.com => "beez" template; uk.example.com => JA Purity template, although both domains share the same content and are served from the same Joomla installation.

6. Page URL

This control allows you to match any part of the full URL used for this HTTP(S) request. The full URL would include the "http://" and the query string, if present. The comparisons are case-insensitive except for the regex / not regex comparisons which are case sensitive.

The control is in 2 parts: a type selector, and a text field.

Type selector options: Ignore | equals | contains | starts with | ends with | matches regex | does not equal | does not contain | does not start with | does not end with | does not match regex

Example: “starts with” “http://www.example.com/blog/”

Example: “ends with” “?landingpage=1”

Important note: If you are not using this control, you must set the Type selector to “Ignore”, even if the text field is empty. Otherwise, the code will attempt to match the empty string, which may not have the desired results. Regex note: regular expressions must contain start and end delimiters, e.g.:  #test[0-9]#

7. Referrer

The URL of the referrer page. This will usually start with http. Beware, this is easy to spoof, so don’t trust it as a security mechanism. It’s still great for templating your site based on particular “feeder” domains though.

See “Page URL” above for a description of how the Type selector works.

Example: “starts with” “http://www.google”

8. Browsers

This control allows you to make the rule succeed or fail based on the type of browser/User Agent being used to access the site. You can select multiple values by holding down the CTRL key (Windows) or Cmd key (Mac). If you select more than one value, then any of the selected values will make the rule SUCCEED.

Options:

  • Ignore
  • Desktop (incl. bots) [uses Categorizr]
  • TV devices [uses Categorizr]
  • Tablet devices (not incl. mobiles) [uses Categorizr]
  • Mobile devices (not incl. tablets) [uses Categorizr]
  • Android
  • Blackberry
  • Chrome
  • Firefox
  • Internet Explorer (all)
  • Internet Explorer (up to and including v6)
  • Internet Explorer (v7)
  • Internet Explorer (v8)
  • Internet Explorer (v9)
  • Internet Explorer (v10)
  • Internet Explorer (v11)
  • iPad
  • iPhone
  • iPod
  • OmniWeb
  • Opera
  • All Safari variants (includes iPod/iPad etc)
  • All Windows browsers
  • All Mac browsers
  • All Linux browsers
  • Googlebot
  • Yahoo! Slurp
  • msnbot
  • All bots/crawlers
  • Games consoles (Wii/Playstation)

For even more options (including specific version detection) you can use the PHP box, and JomGenius Browser detection support.

Last Updated on Wednesday, 15 July 2015 04:12