{% set blockId = blockId ?? block.id %} {% set typeName = block.type.name|t('site') %} {% set tabsBtnLabel = "#{typeName} #{'Tabs'|t('neo')}" %} {% set tabsMenuId = "neoblock-tabs-menu-#{blockId}" %} {% set tabsBtnAttributes = { type: 'button', role: 'button', title: 'Tabs'|t('neo'), aria: { controls: tabsMenuId, label: tabsBtnLabel, }, data: { 'disclosure-trigger': true, 'neo-b': "#{blockId}.button.tabs", }, } %} {% if tabs|length > 1 %} {# Convert the expected form tabs array to layout tabs #} {% set tabs = tabs|map(tab => tab.layoutTab) %} {% set selectedTabUid = selectedTab ?? (tabs|first).uid %} {% set hasErrors = false %}
{%- for tab in tabs -%} {%- set tabName = tab.name|t('site') -%} {%- set tabHasErrors = tab.elementHasErrors(block) -%} {{ tabName }}{# #}{% if tabHasErrors %} {% endif %} {%- set hasErrors = (hasErrors or tabHasErrors) -%} {%- endfor -%}
{% endif %}