templates/Frontend/Pages/page.html.twig line 1

Open in your IDE?
  1. {% extends 'Frontend/_templates/default.html.twig' %}
  2. {% block page_title %}{{ page.seoPageTitle ? page.seoPageTitle : page.name }}{% endblock %}
  3. {% block meta_tags %}
  4.     {% if page.seoDescription %}
  5.         <meta name="description" content="{{ page.seoDescription }}">
  6.     {% endif %}
  7.     {% if page.seoKeywords %}
  8.         <meta name="keywords" content="{{ page.seoKeywords }}">
  9.     {% endif %}
  10. {% endblock %}
  11. {% block content %}
  12.     {% if renderedContent is iterable and renderedContent.main.sections|length %}
  13.         {% set usedColumnWidth = 0 %}
  14.         {% for sectionKey,someSection in renderedContent.main.sections %}
  15.             {% if loop.first %}
  16.                 {# Start a section and row because this is the first one #}
  17.                 <section class="section {{ someSection.config.classes|default('') }}">
  18.                     {% if someSection.fluid == false %}
  19.                         <div class="container">
  20.                             <div class="row">
  21.                     {% endif %}
  22.             {% endif %}
  23.             {# Column #}
  24.             {% if someSection.fluid == false %}
  25.                 <div class="col-md-{{ someSection.size }}">
  26.             {% endif %}
  27.                 {# Loop and render all blocks in this section #}
  28.                 {% for someBlock in someSection.blocks %}
  29.                     {{ someBlock.instance.renderFrontend|raw }}
  30.                 {% endfor %}
  31.             {% if someSection.fluid == false %}
  32.                 </div>
  33.             {% endif %}
  34.             {# Increase column width used in this row so far #}
  35.             {% set usedColumnWidth = usedColumnWidth + someSection.size %}
  36.             {% if loop.last %}
  37.                 {% if someSection.fluid == false %}
  38.                     </div> <!-- end div.row -->
  39.                     </div> <!-- end div.container -->
  40.                 {% endif %}
  41.                 {# Close the row and section because this is the last one #}
  42.                 </section>
  43.             {% else %}
  44.                 {# Do we need to close + start a new section (i.e. next section will exceed max column width) #}
  45.                 {% set nextColumnWidth = renderedContent.main.sections[sectionKey + 1].size %}
  46.                 {% if (usedColumnWidth + nextColumnWidth) > 12 %}
  47.                     {% if someSection.fluid == false %}
  48.                         </div> <!-- end div.row -->
  49.                         </div> <!-- end div.container -->
  50.                     {% endif %}
  51.                     </section>
  52.                     {# Start a new section #}
  53.                     <section class="section {{ renderedContent.main.sections[sectionKey + 1].config.classes|default('') }}">
  54.                         {% if renderedContent.main.sections[sectionKey + 1].fluid == false %}
  55.                             <div class="container">
  56.                             <div class="row">
  57.                         {% endif %}
  58.                     {% set usedColumnWidth = 0 %}
  59.                 {% endif %}
  60.             {% endif %}
  61.         {% endfor %}
  62.     {% else %}
  63.         <section class="section">
  64.             <div class="block block-text">
  65.                 <h1>Nothing Here</h1>
  66.                 <p>
  67.                     This page has no content.
  68.                 </p>
  69.             </div>
  70.         </section>
  71.     {% endif %}
  72.     {% block customContent %}
  73.     {% endblock %}
  74. {% endblock %}