Condition Types

Last Updated: Dec 1, 2023
documentation for the dotCMS Content Management System

In the Conditions section of a Rule, you may select from a number of Condition Types to specify when a Rule will be executed (performing all the Rule Actions). This allows you to customize how your site displays based on the behavior and attributes of the front-end user.

Condition Descriptions

The table below lists and describes each of the condition types available. See the parameters table farther down the page for more granular information on each entry.

Condition NameDescription
BrowserIdentifies the user's browser from the user agent in the request header, and compares it with the browser specified in the Condition.
Browser LanguageIdentifies the language the visitor has selected in their browser by inspecting the request header, and compares it with the lmaguage specified in the Condition.
Current URLCompares the current URL (the URL of the page on which the rule is being evaluated) with the URL specified in the Condition.
  • A Condition that tests only the folder path, instead of the full path to the index page will still evaluate to be true.
    • For example, if “/products/” is the URL specified in the Condition, and the visitor's current URL is “/products/index”, the condition would evaluate to “true”.
  • Parameters added to the end of the Current URL value will be ignored.
    • For example, the if the current URL is “/products/hdtv?id=12345”, it will be compared without the “?id=12345” (e.g. “/products/hdtv”).
Device TypeIdentifies the type of device being used by the visitor from the user agent in the request header, and compares it to the device type specified in the Condition.
Has Visited URLInspects a dotCMS maintained list of visited URLs in the current session to determine if a user has or has not visited a specific URL on your site during their current session.
HTTP MethodEvaluates the whether or not a request is using a particular HTTP Method, such as GET, POST, etc.
Logged InEvaluates whether or not the user is currently logged in, and compares it to the login status specified in the Condition.
Number of Previous VisitsFinds the number of times the user has visited the site previously by inspecting site visitation “cookies” stored on the visitor's device, and compares it to the numeric value specified in the Condition.
Number of VisitsFinds the number of times the user has visited the site by inspecting site visitation “cookies” stored on the visitor's device, adds 1 (for the current visit), and compares the result to the numeric value specified in the Condition.
Note: This value includes the current visit, so it is equal to Number of Previous Visits + 1.
Pages ViewedInspects the dotCMS clickstream to count the number of pages viewed by the user in the current session, and compares it to the value specified in the Condition.
PersonaCompares the visitor's currently assigned Persona](visitors#AssignedPersona) with the Persona specified in the Condition.
Referring URLFinds the Referring URL of the visitor from the request header, and compares it to URL specified in the Condition.
Request AttributeFinds the value of the specified attribute in the request header and compares it to the attribute value specified in the Condition.
Request HeaderFinds the specified value in the request header and compares it to the header value specified in the Condition.
Request ParameterFinds the specified parameter in the request and compares it to the parameter value specified in the Condition.
Selected LanguageIdentifies which dotCMS configured language](configuring-languages) (if any) a user has selected, and compares it with the language specified in the Condition.
Session AttributeFinds the value of the specified attribute in the current session and compares it to the attribute value specified in the Condition.
Visitor Operating SystemIdentifies the user's operating system from the user agent in the request header, and compares it with the operating system specified in the Condition.
Visitor's CountryUses GeoIP2 services to identify the visitor's country based on the visitor's IP address, and compares it to the country specified in the Condition.
Visitor's Date-TimeUses GeoIP2 services to identify the visitor's date and time based on the visitor's IP address, and compares it to the date and time specified in the Condition.
Visitor's LocationUses GeoIP2 services to approximate the visitor's geolocation based on the visitor's IP address, and compares the visitor's geographical distance from the target geolocation with the distance specified in the Condition.

Note:

  • This product includes GeoLite2 data created by MaxMind, available from maxmind.com.
  • The version of the MaxMind GeoIP database that ships with dotCMS is the GeoLite2 free version, which has limited location resolution and is licensed for development purposes only.
    • The GeoIP libraries that ship with dotCMS may be easily upgraded to a more accurate GeoIP database.
    • If you wish to use the MaxMind GeoLite2 database for your production site, or if you wish to perform more accurate geolocation of users based on the user's IP address, you must contact MaxMind and meet all MaxMind requirements for registration or purchase of an appropriate license.

Condition Parameters

The following table displays the required parameters and accepted comparisons for each of the condition types, and the format or value that can be analyzed for each condition.

Condition NameParametersComparisonTypeFormat or Value
BrowserNoneIs,
Is not
SelectionSelections: IE, Edge, Safari, Firefox, Chrome, Opera
Browser LanguageNoneIs,
Is not
SelectionSelected Language (or enter any value)
Current URLNoneIs,
Is not,
Starts with,
Ends with,
Contains,
regex
TextURL
(Please Note: For the “Is”, “Is not”, and “Ends with” comparisons, URL values ending in a / will automatically reference the CMS_INDEX_PAGE property for the folder. For example, somefolder/ will be treated as somefolder/{CMS_INDEX_PAGE}. References to folders without the trailing / will not automatically reference the CMS_INDEX_PAGE page property.)
Device TypeNoneIs,
Is not
SelectionSelections: Computer, Mobile, Tablet, Wearable computer, Digital media receiver, Game console
Has Visited URLNoneIs not,
Starts with,
Ends with,
Contains,
regex
TextURL
HTTP MethodNoneIs,
Is not
SelectionSelections: DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUT
Logged InNoneIs,
Is not
NoneN/A
Number of Previous VisitsNoneIs equal to,
Is less than,
Is greater than,
Is less than or equal to,
Is greater than or equal to
IntegerNumber of previous visits (not including the current visit)
Number of VisitsNoneIs equal to,
Is less than,
Is greater than,
Is less than or equal to,
Is greater than or equal to
IntegerNumber of visits (including the current visit)
Pages ViewedNoneIs equal to,
Is not equal to,
Is less than,
Is greater than,
Is less than or equal to,
Is greater than or equal to
IntegerNumber of pages
PersonaNoneIs,
Is not
SelectionSelect a Persona from the list of Personas defined on the system.
Referring URLNoneIs,
Is not,
Exists,
Starts with,
Ends with,
Contains,
regex
TextURL
Request AttributeAttribute NameIs,
Is not,
Exists,
Starts with,
Ends with,
Contains,
regex
TextAttribute Value
Request HeaderAny standard (or custom) header nameIs,
Is not,
Exists,
Starts with,
Ends with,
Contains,
regex
TextHeader Value
Request ParameterParameter NameIs,
Is not,
Exists,
Starts with,
Ends with,
Contains,
regex
TextParameter Value
Selected LanguageNoneIs,
Is not
SelectionSelect from a list of languages configured in dotCMS
Session AttributeAttribute NameIs,
Is not,
Exists,
Starts with,
Ends with,
Contains,
regex
TextAttribute Value
Visitor Operating SystemNoneIs,
Is not
SelectionSelect from a list of Operating System values supported by the User Agent Viewtool
Visitor's CountryNoneIs,
Is not
SelectionSelected Language (or enter any value)
Visitor's Date-TimeNoneIs between,
Is greater than,
Is less than
Date and TimeEnter the Date & Time or Select from the Calendar
Visitor's LocationRedius in miles/kilometersWithin,
Not Within
LocationSet the location using the visual map

On this page

×

We Dig Feedback

Selected excerpt:

×