templates/blog/post/index.html.twig line 1

  1. {% extends 'core/front/front.layout.html.twig' %}
    {% block title %}{{ 'news.title'|trans({}, 'app') }}{% endblock %}
    {% block front %}
        <section class="section section-banner text-white text-center py-3 py-lg-5">
            <div class="container ">
                <h1>{{ 'news.title'|trans({}, 'app') }}</h1>
                <p>{{ 'news.subtitle'|trans({}, 'app') }}</p>
                <div class="d-none d-md-block form-banner pt-4 block-newsletter-form mb-5 pb-5">
                    <div class="block-newsletter-form mt-0 pt-0" id="news-letter-container">
                        {% include 'core/front/contact/shared/subscribe-email-form.html.twig' with {'form':form} %}
                    </div>
                    <p class="text-white mt-2">
                        {{ 'news.data_protection.text'|trans({}, 'app') }}
                        {% if privatePage is not null %}
                            <a href="{{ path('app_front_cms_page',{id: privatePage.id, slug: privatePage.i18n(locale).slug}) }}" target="_blank">
                                {{ 'news.data_protection.link'|trans({}, 'app') }}
                            </a>
                        {% endif %}
                    </p>
                </div>
            </div>
        </section>
    
        <section class="section py-5 section-posts bg-gray section-tabs-filter">
            <div class="container">
                <div class="filter-table">
                    <div class="d-flex gap-3 justify-content-between filter-table-header pb-4 align-items-start">
                        <ul class="filters">
                            <li>
                                <a href="{{ path('app_blog_posts') }}" class="{% if categoryId <=0  %}active{% endif %}">
                                    {{ 'news.filter.all'|trans({}, 'app') }}
                                </a>
                            </li>
                            {% for elt in categories %}
                                <li>
                                    <a class="{% if categoryId ==elt.id  %}active{% endif %}" href="{{ path('app_blog_posts') }}?category={{ elt.id }}">
                                        {{ elt.i18n(locale).name }}
                                    </a>
                                </li>
                            {% endfor %}
                        </ul>
                    </div>
                    <div class="filter-items pb-4 d-flex row row-cols-1 row-cols-lg-3 row-cols-md-2 row-gap-3 listing-news">
                        {% for item in entities %}
                            <div class="filter-item col post" data-filter="filter1">
                                <div class="post-news-content">
                                    <div class="post-thumb">
                                        <a href="{{ path('app_blog_posts_single',{id:item.id, slug: item.i18n(locale).slug}) }}" title="{{ 'news.read_article'|trans({}, 'app') }}">
                                            {% if item.thumbnail is not null and file_exists(item.thumbnail.url) %}
                                                <img class="" src="{{ asset(item.thumbnail.url) }}" alt="{{ item.i18n(locale).name }}"/>
                                            {% else %}
                                                <img class="" src="{{ asset('img/defaults/media.png') }}" alt="{{ item.i18n(locale).name }}"/>
                                            {% endif %}
                                        </a>
                                    </div>
                                    <div class="post-news-infos d-flex flex-wrap gap-2 flex-column same-height" style="height: 239px;">
                                        <div class="post-date">
                                            <span>{{ item.publishDate|date('d M Y')|upper }}</span>
                                        </div>
                                        <h2>
                                            <a href="{{ path('app_blog_posts_single',{id:item.id, slug: item.i18n(locale).slug}) }}" title="{{ 'news.read_article'|trans({}, 'app') }}">
                                                {{ item.i18n(locale).name|read_more(90)|raw }}
                                            </a>
                                        </h2>
                                        <p>{{ item.i18n(locale).excerptDescription|read_more|raw }}</p>
                                        <a href="{{ path('app_blog_posts_single',{id:item.id, slug: item.i18n(locale).slug}) }}" class="read-more">
                                            {{ 'news.read_article'|trans({}, 'app') }} <i class="fa-solid fa-arrow-right"></i>
                                        </a>
                                    </div>
                                </div>
                            </div>
                        {% endfor %}
                    </div>
                    <div class="pagination d-flex gap-3 justify-content-center mt-3 d-none">
                        <a href="#" title="" class="prev_navigation arrow_navigation">
                            <i class="fa-solid fa-arrow-left"></i> {{ 'pagination.previous'|trans({}, 'app') }}
                        </a>
                        <div class="page-numbers">
                            {{ 'pagination.page'|trans({}, 'app') }} <span>2</span> {{ 'pagination.of'|trans({}, 'app') }} <span>10</span>
                        </div>
                        <a href="#" title="" class="next_navigation arrow_navigation">
                            {{ 'pagination.next'|trans({}, 'app') }} <i class="fa-solid fa-arrow-right"></i>
                        </a>
                    </div>
                </div>
            </div>
        </section>
    {% endblock %}