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

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

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

{% block subheader -%}

    {% set contentTop =  customContentClassifiedHome(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-5 col-md-4 col-sm-12 text-center-sm">
                        <br>

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

    </section>

{% endblock -%}

{% block body -%}

    {% import "::blocks/utility/banners.html.twig" as banners %}
    {% set contentTop =  customContentClassifiedHome(true) %}

    <main>
        {# Popular -#}
        <section class="block">
            <div class="container">

                {{ contentTop.content|raw }}
                <br>

                {% set featured_classified = featuredClassified(3, 'col-sm-4') %}
                {% if featured_classified is not empty %}
                    <h2 class="theme-title">
                        {{ 'Featured Classifieds'|trans }}
                    </h2>
                    <div class="row">
                        {{ featured_classified|raw }}
                    </div>
                {% endif %}
            </div>
        </section>

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

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

        {# Popular Classfieds -#}
        <section class="block">
            <div class="container">
                {% set popular = popularClassified(2, 3, 'col-sm-4') %}
                {% if popular is not empty %}
                    <h2 class="theme-title">
                        {{ 'Popular CLassifieds'|trans }}
                    </h2>
                    {{ popular|raw }}
                {% endif %}

                {{ customContentClassifiedHomeBottom() }}
            </div>
        </section>

    </main>
{% endblock -%}

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