Condition Types

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.

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./n - A Condition that tests only the folder path, instead of the full path to the index page will still evaluate to be true./n - 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". /n - Parameters added to the end of the Current URL value will be ignored. /n 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./nNote: 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,/nIs notSelectionSelections: IE, Edge, Safari, Firefox, Chrome, Opera
Browser LanguageNoneIs,/nIs notSelectionSelected Language (or enter any value)
Current URLNoneIs,/nIs not,/nStarts with,/nEnds with,/nContains,/nregexTextURL/n(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,/nIs notSelectionSelections: Computer, Mobile, Tablet, Wearable computer, Digital media receiver, Game console
Has Visited URLNoneIs not,/nStarts with,/nEnds with,/nContains,/nregexTextURL
HTTP MethodNoneIs,/nIs notSelectionSelections: DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUT
Logged InNoneIs,/nIs notNoneN/A
Number of Previous VisitsNoneIs equal to,/nIs less than,/nIs greater than,/nIs less than or equal to,/nIs greater than or equal toIntegerNumber of previous visits (not including the current visit)
Number of VisitsNoneIs equal to,/nIs less than,/nIs greater than,/nIs less than or equal to,/nIs greater than or equal toIntegerNumber of visits (including the current visit)
Pages ViewedNoneIs equal to,/nIs not equal to,/nIs less than,/nIs greater than,/nIs less than or equal to,/nIs greater than or equal toIntegerNumber of pages
PersonaNoneIs, /nIs notSelectionSelect a Persona from the list of Personas defined on the system.
Referring URLNoneIs,/nIs not,/nExists,/nStarts with,/nEnds with,/nContains,/nregexTextURL
Request AttributeAttribute NameIs,/nIs not,/nExists,/nStarts with,/nEnds with,/nContains,/nregexTextAttribute Value
Request HeaderAny standard (or custom) header nameIs,/nIs not,/nExists,/nStarts with,/nEnds with,/nContains,/nregexTextHeader Value
Request ParameterParameter NameIs,/nIs not,/nExists,/nStarts with,/nEnds with,/nContains,/nregexTextParameter Value
Selected LanguageNoneIs, /nIs notSelectionSelect from a list of languages configured in dotCMS
Session AttributeAttribute NameIs,/nIs not,/nExists,/nStarts with,/nEnds with,/nContains,/nregexTextAttribute Value
Visitor Operating SystemNoneIs, /nIs notSelectionSelect from a list of Operating System values supported by the User Agent Viewtool
Visitor's CountryNoneIs, /nIs notSelectionSelected Language (or enter any value)
Visitor's Date-TimeNoneIs between,/nIs greater than,/nIs less thanDate and TimeEnter the Date & Time or Select from the Calendar
Visitor's LocationRedius in miles/kilometersWithin,/nNot WithinLocationSet the location using the visual map