FooterGroupSelector¶
FooterGroupSelector element is a select list with links group.

Build-in Validators¶
Element validate if chosen links group exists.
Available Validators¶
Element has available validators:
Relations Support¶
Element does not support relations between elements.
Configuration output schema¶
schema
{
"<element_type>" : "footerGroupSelector",
"<element_name>" : string,
"<element_label>" : string,
"<element_labelDescription>" : string,
"<element_isRequired>" : bool,
"<element_isHidden>" : bool,
"<element_supportsTranslations>" : bool,
"<element_defaultValue>" : int,
"<element_validators>" : []
}
example
{
"type" : "footerGroupSelector",
"name" : "footer_group",
"label" : "Displayed group of links",
"isRequired" : false,
"isHidden" : false,
"supportsTranslations" : true,
"defaultValue" : 12,
"validators": [
{ "type" : "lessEqThan", "options" : { "max" : 25 } }
]
}
Element value¶
If value is filled: int.
usage in module TWIG
{% if moduleConfig.footer_group %}
Displayed footer links group ID: {{ moduleConfig.footer_group }}
{% endif %}
Example of module¶
Twig¶
Twig
{% set footerGroupId = moduleConfig.selectedFooterGroupId %}
{% if footerGroupId %}
{% set footerGroup = ObjectApi.getFooterGroup(footerGroupId) %}
{% if footerGroup %}
<section>
<div>
<h2 class="h2">{{ translate("Group") }}: {{ footerGroup.name }}</h2>
{% if moduleConfig.showLinks %}
<ul>
{% for footerLink in footerGroup.links %}
<li>
<a href="{{ footerLink.url }}" title="{{ footerLink.title }}">
{{ footerLink.title }}
</a>
</li>
{% endfor %}
</ul>
{% endif %}
</div>
</section>
{% endif %}
{% endif %}
JSON configuration¶
JSON configuration
[
{
"label": "Footer Group",
"state": "unfolded",
"elements": [
{
"name": "selectedFooterGroupId",
"type": "footerGroupSelector",
"label": "Select Footer Group",
"supportsTranslations": true
},
{
"name": "showLinks",
"type": "checkbox",
"label": "Show footer group links"
}
]
}
]
JSON translations¶
JSON translations
{
"module": {
"pl_PL": {
"Group": "Grupa"
},
"en_US": {
"Group": "Group"
}
},
"schema": {
"pl_PL": {
"Footer Group" : "Grupa stopki",
"Select Footer Group" : "Wybierz grupę stopki",
"Show footer group links" : "Pokaż linki w grupie stopki"
},
"en_US": {
"Footer Group" : "Footer Group",
"Select Footer Group" : "Select Footer Group",
"Show footer group links" : "Show footer group links"
}
}
}