{% extends '::base.html.twig' -%}

{% block SEO %}
    {{ generateSEOFromContent( customContentArticleHome(true), "%module% Homepage"|trans({"%module%" : "Article"|trans}) ) }}
{% endblock -%}

{% block subheader -%}
    {% set contentTop =  customContentArticleHome(true) %}
    {# Top Search -#}
    <section class="top-search">

        {# General Background Image -#}
        {{ include("::blocks/background-image.html.twig") }}

        <div class="well well-translucid">
            <div class="container">
                <div class="row">
                    <div class="col-lg-7 col-md-8 col-sm-12 text-center-sm">
                        <br>

                        <h1>{{ contentTop.title }}  </h1>
                    </div>
                    <div class="col-lg-5 col-md-4 col-sm-12">
                        <div id="search-responsive" class="search-collapse collapse">
                            <div class="well well-translucid form-inline text-center">
                                {{ addJSTwigParameter("searchBoxModule", "article") }}
                                {{ include("::blocks/search/search-fields-small.html.twig") }}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </section>

{% endblock -%}

{% block topbanner -%}
    {{ banners.top("article") }}
{% endblock -%}

{% block body -%}
    {% import "::blocks/utility/banners.html.twig" as banners %}

    <main>

        {# Must Read Articles -#}
        {# popular -#}
        <section class="block">
            <div class="container">

                {% set contentTop =  customContentArticleHome(true) %}
                {{ contentTop.content|raw }}

                <br>

                {% set must_read = mustReadArticle(3, 'col-sm-4', 'vertical') %}
                {% if must_read is not empty %}
                    <h2 class="theme-title">
                        {{ 'Must Read Articles'|trans }}
                    </h2>

                    <div class="row">
                        {{ must_read|raw }}
                    </div>
                {% endif %}

            </div>
        </section>

        {{ banners.middle("article") }}

        {# Category -#}
        {% set cat = browseByCategoryArticle() %}
        {% if cat is not empty %}
            <section class="block">
                {{ cat|raw }}
            </section>
        {% endif %}

        <!-- Recent Articles -->
        {% set recent_article = recentArticle(4, 'col-sm-3') -%}
        {% if recent_article is not empty -%}
            <section class="block">
                <div class="container">
                    <h2 class="theme-title">
                        {{ 'Recent Articles'|trans }}
                    </h2>

                    <div class="row">
                        {{ recent_article|raw }}
                    </div>
                </div>
            </section>
        {% endif -%}

        <div class="block">
            <div class="container"><br>{{ customContentArticleHomeBottom() }}</div>
        </div>

    </main>
{% endblock -%}

{% block bottombanners -%}
    {% import "::blocks/utility/banners.html.twig" as banners %}
    {{ banners.bottom("article") }}
{% endblock -%}
