{{ hiddenInput(name, '') }}
{% set totalNewBlocks = 0 %} {% for block in blocks %} {% set blockId = block.id %} {% if not blockId %} {% set totalNewBlocks = totalNewBlocks + 1 %} {% set blockId = 'new'~totalNewBlocks %} {% endif %} {% set baseInputName = "#{name}[blocks][#{blockId}]" %}
{% if not static %} {{ hiddenInput("#{name}[sortOrder][]", blockId) }} {% do view.registerDeltaName(baseInputName) %} {{ hiddenInput("#{baseInputName}[type]", block.getType().handle) }} {{ hiddenInput("#{baseInputName}[enabled]", block.enabled ? '1' : '') }}
{{ block.getType().name|t('site') }} {% if block.hasErrors() %}{% endif %}
{% endif %}
{% include "_includes/fields" with { namespace: "#{baseInputName}[fields]", element: block, fields: block.getType().getFieldLayout().getFields(), static: static, registerDeltas: true, } %}
{% endfor %}
{% if not static and not staticBlocks %}
{% for blockType in blockTypes %}
{{ blockType.name|t('site') }}
{% endfor %}
{% endif %}