{% from 'neo/macros' import getBlockId %} {% set neoSettings = craft.app.plugins.getPlugin('neo').settings %} {% set type = block.type %} {% set typeTabs = type.getFieldLayout().getTabs() %} {% set typeName = type.name|t('site') %} {% set hasTabs = typeTabs is not empty %} {% set isParent = static and block.children.exists() or not static and type.childBlocks is not null and type.childBlocks is not empty %} {% set collapsed = collapsed ?? (neoSettings.collapseAllBlocks or block.collapsed) %} {% set blockId = getBlockId(block) %} {% set isNew = block.id is null %} {% set hasErrors = block.hasErrors() %} {% set showFormAndTabs = hasTabs or isParent %} {% set renderedForm = null %} {% set formTabs = null %} {% set visibleLayoutElements = {} %} {% set ignorePermissions = not neoSettings.enableBlockTypeUserPermissions or type.ignorePermissions %} {# Get the errors specific to the block (i.e. not subfield errors) #} {% set blockErrors = [] %} {% for attribute, errors in block.getErrors() %} {% if attribute[:5] == '__NEO' %} {% set blockErrors = blockErrors|merge(errors) %} {% endif %} {% endfor %} {% set errorList -%} {%- if blockErrors is not empty %}