{% extends 'Frontend/_templates/default.html.twig' %}
{% block page_title %}{{ page.seoPageTitle ? page.seoPageTitle : page.name }}{% endblock %}
{% block meta_tags %}
{% if page.seoDescription %}
<meta name="description" content="{{ page.seoDescription }}">
{% endif %}
{% if page.seoKeywords %}
<meta name="keywords" content="{{ page.seoKeywords }}">
{% endif %}
{% endblock %}
{% block content %}
{% if renderedContent is iterable and renderedContent.main.sections|length %}
{% set usedColumnWidth = 0 %}
{% for sectionKey,someSection in renderedContent.main.sections %}
{% if loop.first %}
{# Start a section and row because this is the first one #}
<section class="section {{ someSection.config.classes|default('') }}">
{% if someSection.fluid == false %}
<div class="container">
<div class="row">
{% endif %}
{% endif %}
{# Column #}
{% if someSection.fluid == false %}
<div class="col-md-{{ someSection.size }}">
{% endif %}
{# Loop and render all blocks in this section #}
{% for someBlock in someSection.blocks %}
{{ someBlock.instance.renderFrontend|raw }}
{% endfor %}
{% if someSection.fluid == false %}
</div>
{% endif %}
{# Increase column width used in this row so far #}
{% set usedColumnWidth = usedColumnWidth + someSection.size %}
{% if loop.last %}
{% if someSection.fluid == false %}
</div> <!-- end div.row -->
</div> <!-- end div.container -->
{% endif %}
{# Close the row and section because this is the last one #}
</section>
{% else %}
{# Do we need to close + start a new section (i.e. next section will exceed max column width) #}
{% set nextColumnWidth = renderedContent.main.sections[sectionKey + 1].size %}
{% if (usedColumnWidth + nextColumnWidth) > 12 %}
{% if someSection.fluid == false %}
</div> <!-- end div.row -->
</div> <!-- end div.container -->
{% endif %}
</section>
{# Start a new section #}
<section class="section {{ renderedContent.main.sections[sectionKey + 1].config.classes|default('') }}">
{% if renderedContent.main.sections[sectionKey + 1].fluid == false %}
<div class="container">
<div class="row">
{% endif %}
{% set usedColumnWidth = 0 %}
{% endif %}
{% endif %}
{% endfor %}
{% else %}
<section class="section">
<div class="block block-text">
<h1>Nothing Here</h1>
<p>
This page has no content.
</p>
</div>
</section>
{% endif %}
{% block customContent %}
{% endblock %}
{% endblock %}