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

Skip to content

Text

Text element is an input with text type.

text

Options

prefix

string Optional parameter.

postfix

string Optional parameter.

placeholder

string Optional parameter. Placeholder in input.

JSON
{
  "options":
    {
      "prefix" : "+48",
      "placeholder" : "phone number"
    }
}

Build-in Validators

Element has no build-in validators.

Available Validators

Element has available validators:

Relations Support

Element supports relations between elements.

Configuration output schema

schema
{
  "<element_type>" : "text",
  "<element_name>" : string,
  "<element_label>" : string,
  "<element_labelDescription>" : string,
  "<element_isRequired>" : bool,
  "<element_isHidden>" : bool,
  "<element_defaultValue>" : string,
  "<element_options>" : {
    "<element_option_prefix>" : string,
    "<element_option_postfix>" : string,
    "<element_option_placeholder>" : string
  },
  "<element_validators>" : []
}
example
{
  "type" : "text",
  "name" : "phone",
  "label" : "Phone number",
  "labelDescription" : "Leave your phone number for further contact",
  "isRequired" : true,
  "isHidden" : false,
  "validators": [
    {
      "type" : "length",
      "options" : { "min" : 9, "max" : 12 }
    }
  ],
  "options": {
    "prefix" : "+48",
    "placeholder" : "phone number"
  }
}

Element value

If value is filled: string.

usage in module TWIG
{% if moduleConfig.phone %}
    <p>Phone number: {{ moduleConfig.phone }}</p>
{% endif %}