seacms-theme/includes/yaml_error.twig
2023-02-16 20:34:18 +01:00

24 lines
802 B
Twig

{# SPDX-License-Identifier: EUPL-1.2 #}
{% set pages_with_error = [] %}
{% for page in pages(depthOffset=-1,depth=null) %}
{% if page.meta.YAML_ParseError %}
{% set pages_with_error = pages_with_error|merge([{"id": page.id, "error": page.meta.YAML_ParseError}]) %}
{% endif %}
{% endfor %}
{% for page in pages_with_error %}
{% if loop.first %}
<div class="fixed-top mt-5">
<div class="container mt-5 pt-3">
{% endif %}
<div class="alert alert-danger">
<h1 class="h6"><i class="fas fa-exclamation-triangle me-2"></i><strong>YAML Header Error</strong> in <a href="{{ page.id }}">{{ page.id }}</a>:</h1>
<p class="mb-0">{{ page.error }}</p>
</div>
{% if loop.last %}
</div>
</div>
{% endif %}
{% endfor %}