Thanks to visit codestin.com
Credit goes to storefront.developers.shoper.pl

Skip to content

Checkbox

Checkbox element is an input with checkbox type. It is similar to SwitchCheckbox element. They differ in appearance.

checkbox

Build-in Validators

Element has one build-in validator - checks if value equals 0 or 1.

Available Validators

Element does not have available validators.

Relations Support

Element supports relations between elements.

Configuration output schema

schema
{
  "<element_type>" : "checkbox",
  "<element_name>" : string,
  "<element_label>" : string,
  "<element_labelDescription>" : string,
  "<element_isRequired>" : bool,
  "<element_isHidden>" : bool,
  "<element_defaultValue>" : int
}
example
{
    "type": "checkbox",
    "name": "shouldShowAuthor",
    "label": "Author of the entry",
    "defaultValue": 0
}

Element value

If value is filled it can be 0 or 1.

usage in module TWIG
{% if moduleConfig.shouldShowAuthor %}
    <li class="blog-article-details__item">
        {{ translate('author') }}: <span class="blog-article-details__detail">AUTHOR</span>
    </li>
{% endif %}