Conditional values

Enterprise plan only

Conditional values requires a Uniform Enterprise plan.

Conditional values let you choose between one or more alternative values for component parameters or content type fields ('properties') based on conditional expressions.

  • Define fallback values when external data is not available.
  • Adjust layout settings or content based on current user context such as screen size or device type.
  • Map technical details to human-readable values. E.g. map a country code to a country name.
  • Translate external data attributes that are not translated by default. E.g. translate a product category name that is retrieved from an external product catalog.
CriteriaComponents & CompositionsComponent patterns & composition patternsEntries & Entry patterns
Locales🚫 Not supported🚫 Not supported🚫 Not supported
Dynamic inputsβœ… Supported
(if attached to a project map node)
🚫 Not supported🚫 Not supported
Quirksβœ… Supportedβœ… Supported🚫 Not supported
Dynamic Tokensβœ… Supportedβœ… Supportedβœ… Supported

Each property must enable conditional values on its component or content type definition. This is done by checking the "Enable conditional values" checkbox when adding or editing a parameter or field.

allow-conditional-values
Allow conditional values for a parameter of a component or field of a content type

Conditional values are not supported for fields of type blocks.

tip

Conditional values work in concert with localized values; when localized, each locale has its own independent set of conditional values.

To create a conditional value:

  1. Open a component or entry and navigate to the property, that has conditional values enabled, and you want to add conditional values to.

  2. In the property's menu, choose "Manage conditional values…". This opens the conditional values editor in a drawer for the current locale.

    conditional-values-menu
    Manage conditional values menu
  3. Click "Add conditional value" to add the first conditional value. The default value is automatically copied to the new conditional value. Adjust the value as needed.

    add-conditional-value
    Add conditional value to a parameter
  4. The new conditional value starts of with no conditions, which means it is always used. Click the "No conditions defined" box, or choose "Manage conditions" from the value's menu to open the conditional expression editor.

    manage-conditions
    Manage conditions of a conditional value
  5. Choose a conditional expression to show the component. As you work, the current result of the conditional expression is shown based on your current preview settings (i.e. preview product ID).

    applied-conditional-value
    Matching conditional value is shown in preview and in parameter
  6. Click Accept. The condition is applied.

Order of condition evaluation

When evaluating conditional expressions, Uniform starts at Condition 1 and uses the first matching conditional value. If no conditional values match, then the default value is used instead.

You can reorder conditions in their menu to control the order of evaluation.