The Rule form: Details & Config

(0 votes, average 0 out of 5)

1-cham-details-config-form

1. Title

Give the rule a descriptive title. This is the title that displays in the list in the Rule Chain page.

2. Status

If a rule is not published, it is completely ignored by Chameleon, and skipped as the rule chain is processed.

3. Ordering

You can change the ordering of your rule here, or re-shuffle them in the Rule Chain manager.

4. Comments

A place for you to make notes about what this rule is for, and why it’s set up the way that it is.

5. Enable GeoIP/GeoCity

GeoIP lookups are quite fast, but this control enables you to only switch on the lookups if you know you need them for this rule.

Options: Disabled | GeoIP Country (free or commercial) | GeoLite City (free) | GeoCity (commercial)

6. $language handling

Chameleon creates variables $language, $language_code and $language_region for use in the PHP box, and also in the “only these languages” and “exclude these languages” boxes. This drop-down determines where this language setting comes from.

Options: Joomla front-end language | Browser’s preferred language | Most preferred language from supplied list

“Joomla front-end language”: self-explanatory. Taken from the site default language, or the Joom!Fish language button that a user may have clicked.

“Browser’s default language”: every web browser is set up with a default language, which can be used by web sites to indicate which language content to serve. When an OS (e.g. Windows/Mac) is set up in a particular language, this usually causes the web browser to send this language capability to web sites. Therefore it is a reasonably good indicator of the language of the person browsing the site. Note however that in many European countries it is common for this to be set to English rather than the local language.

“Most preferred language from supplied list”: This is an advanced option and not the same as the “Only these languages” control in the Environment section!

This option is similar to “Browser’s default language” in that it determines $language based on values from the browser. However, because browsers can send more than one language in order of preference, this option attempts to intelligently determine the “Best fit” language by comparing the list of languages from the browser, with the list of languages supplied in the next text box.

7. Preferred list of languages

  • Comma-separated list of preferred language codes, lower case.
  • If “Most preferred language from supplied list” is specified above, then $language will contain the language from this list that appears highest in the browser’s preferred language settings.
  • E.g. a browser may be set up for “ar,fr”. If you only test for the first language in the list, but have no content to display for Arabic (ar), you might miss the opportunity to present your French (fr) content. So by specifying a list of the languages you do cater for here, Chameleon will return the one that ranks highest for a particular visitor.
  • If “Strict language comparison” is turned off, then specifying a major language here (e.g. fr) will match any variants of that in the user’s browser, such as fr-fr, fr-ch, fr-be or plain fr.
  • Usage example: de,fr-fr,fr-be,cs

8. Strict language comparison

For use with “Most preferred language from supplied list” above. If turned off, then specifying a major language here (e.g. fr) will match any variants of that in the user’s browser, such as fr-fr, fr-ch, fr-be or plain fr.

9. Honour template set in session/cookies/GET/POST

In order to integrate with other modules/components, Chameleon is able to detect the style id of the chosen template in a cookie, URL parameter or in a session or POST request. e.g. you might create a module which allows the user to use a dropdown to select from a list of templates, and this module may set a cookie with the desired template style id in it.

Chameleon can use this value as the default template for this rule. The SUCCEED or FAIL actions can still override it as a result of the rest of the rule.

If you set this to On then the following cookies/sessions/GET/POST variables are checked:  template | joomla_template

e.g. this will pick up the template style id value from any of these requests:

  • yoursite.com/my/page?template=9
  • yoursite.com/my/page?joomla_template=9
  • a request with a cookie where joomla_template=9
  • a POST request with a parameter of template=9
  • any request where there is already a session with $_SESSION['template'] == '9'

Note that the id number is the id of the style of the template, not the name of the template.

Last Updated on Monday, 06 October 2014 03:14