{% set totalNewBlocks = 0 %} {% for block in blocks %} {% set blockId = block.id %} {% if not blockId %} {% set totalNewBlocks = totalNewBlocks + 1 %} {% set blockId = 'new'~totalNewBlocks %} {% endif %}
{% if not static %}
{{ block.getType().name|t('site') }}
{% endif %}
{% include "_includes/fields" with { namespace: name~'['~blockId~'][fields]', element: block, fields: block.getType().getFieldLayout().getFields(), static: static } %}
{% endfor %}
{% if not static and not staticBlocks %}
{% for blockType in blockTypes %}
{{ blockType.name|t('site') }}
{% endfor %}
{% endif %}