Defining Template Conditions

Templates are assigned to pages using assignment rules.

Template assignment rule is a JavaScript function that returns TRUE if template matches the current PC page and returns FALSE if it does not. The location parameter is the only parameter available in the function. This parameter can be used for testing PC page URL and other properties.

To define condition for a template, you should:

  1. Open Template Manager by clicking the Template Manager button on the left sidebar.

  2. Expand the required template by clicking on the template title.

  3. Select the kind of condition you want to define by clicking on it.

  4. Type the condition in the Condition Field

    Enter condition

    Note

    Define case sensitivity for the conditions of the Equal, Starts with, or Contains type.

Template properties will be saved automatically.

When defining conditions, you can use any standard JavaScript expressions and Flamingo API functions.

Condition Types

Use links below to learn how each condition type works and how to use it.

Equal Condition

Use this condition type to assign your template to a single page.

Starts With Condition

Use this condition type to assign your template to page(s) URL of which starts with the specified string.

Contains Condition

Use this condition type to assign your template to page(s) URL of which contains the specified string.

RegExp Condition

Use this condition to define page(s) to assign template to with the help of regular expressions.

XPath Condition

Use this condition to assign your template to page(s) on which the specified XPath expression can be executed.

JavaScript Condition

Use this condition to assign template to page(s) with the help of native JavaScript expressions.