{% for blockType in blockTypes %} {% for field in blockType.getFieldLayout().getFields() %} {% set width = supertableField.columns[field.uid].width ?? '' %} {% set translatable = field.getIsTranslatable() %} {% if translatable %} {% switch field.translationMethod %} {% case 'site' %} {% set translationDescription = 'This field is translated for each site.'|t('app') %} {% case 'siteGroup' %} {% set translationDescription = 'This field is translated for each site group.'|t('app') %} {% case 'language' %} {% set translationDescription = 'This field is translated for each language.'|t('app') %} {% endswitch %} {% endif %} {% endfor %} {% endfor %} {% if not staticField %} {% endif %} {% set totalNewBlocks = 0 %} {% for block in blocks %} {% set blockId = block.id %} {% set blockIsNew = blockId is empty %} {% if blockIsNew %} {% set totalNewBlocks = totalNewBlocks + 1 %} {% set blockId = 'new' ~ totalNewBlocks %} {% endif %} {% set baseInputName = "#{name}[blocks][#{blockId}]" %} {# only register a delta name for this black if it's not new #} {% if not blockIsNew %} {% do view.registerDeltaName(baseInputName) %} {% endif %} {% include "super-table/table/fields" with { namespace: "#{baseInputName}[fields]", element: block, fields: block.getType().getFieldLayout().getFields(), settings: supertableField, registerDeltas: not blockIsNew, } %} {% if not staticField %} {% else %} {# Prevents case where inner Table fields will collapse everything #} {% endif %} {% endfor %}
{{ field.name | t('site') }} {% if field.instructions %}{{ field.instructions | t('site') | e | md }}{% endif %} {% if translatable %}{% endif %}
{% if not staticField %}
{{ supertableField.selectionLabel | default("Add a row") | t('site') }}
{% endif %}