Skip to content

CategorySelector

CategorySelector element is a select list with categories.

category-selector

Build-in Validators

Element validate if chosen category exists.

Available Validators

Element has available validators:

Relations Support

Element does not support relations between elements.

Configuration output schema

schema
{
  "<element_type>" : "categorySelector",
  "<element_name>" : string,
  "<element_label>" : string,
  "<element_labelDescription>" : string,
  "<element_isRequired>" : bool,
  "<element_isHidden>" : bool,
  "<element_defaultValue>" : int,
  "<element_validators>" : []
}
example
{
  "type" : "categorySelector",
  "name" : "category",
  "label" : "Displayed category",
  "isRequired" : false,
  "isHidden" : false,
  "defaultValue" : 12,
  "validators": [
    {
      "type" : "lessEqThan",
      "options" : { "max" : 25 }
    }
  ]
}

Element value

If value is filled: int.

usage in module TWIG
{% if moduleConfig.category %}
    Displayed category ID: {{ moduleConfig.category }}
{% endif %}