templates/widget/news_last.html.twig line 1

Open in your IDE?
  1. <section class="std-section news-last">
        <div class="container">
            <div class="news-last__container">
                <div class="news-last__heading-wrapper">
                    {% if title %}
                        <h2 class="news-last__heading h3">{{ title }}</h2>
                    {% endif %}
                    {% if link %}
                        <div class="news-last__all-news">
                            <a href="{{ link }}">{{ link_name }}</a>
                        </div>
                    {% endif %}
                    <div class="news-last__controls">
                        <button class="arrow arrow-prev">
                            <svg>
                                <use href="/assets/front/img/icons/control-arrow.svg#arrow" xlink:href="/assets/front/img/icons/control-arrow.svg#arrow"></use>
                            </svg>
                        </button>
                        <button class="arrow arrow-next">
                            <svg>
                                <use href="/assets/front/img/icons/control-arrow.svg#arrow" xlink:href="/assets/front/img/icons/control-arrow.svg#arrow"></use>
                            </svg>
                        </button>
                    </div>
                </div>
                <div class="news-last__slider">
                    <div class="swiper-wrapper">
                        {% for news in news_list %}
                            <div class="news-last__article swiper-slide">
                                <a class="news-last__link" href="{{ path('news_show', {'categoryAlias': news.category.alias, 'id': news.id}) }}" target="_blank"></a>
                                {% if news.picture %}
                                    <div class="news-last__article-image">
                                        <img class="swiper-lazy" src="{{ asset('assets/front/img/empty.svg') }}"
                                             data-src="{{ news.picture.url }}" alt="{{ news.name|escape }}" loading="lazy">
                                    </div>
                                {% endif %}
                                <h3 class="news-last__article-headline">{{ news.name }}</h3>
                                <span class="news-last__article-description">{{ news.annotation|raw }}</span>
                                <div class="news-last__more">
                                    <a href="{{ path('news_show', {'categoryAlias': news.category.alias, 'id': news.id}) }}">Подробнее</a>
                                </div>
                            </div>
                        {% endfor %}
                    </div>
                    <div class="news-last__pagination"></div>
                </div>
                {% if link %}
                    <div class="news-last__all-news">
                        <a href="{{ link }}">{{ link_name }}</a>
                    </div>
                {% endif %}
            </div>
        </div>
        <script data-defer=".news-last">
            var requireOnDefer = function() {
                function callback() {
                    require(['assets/front/js/application/news-last']);
                    window.removeEventListener('.news-last', callback);
                }
                window.addEventListener('.news-last', callback);
            }
            requireOnDefer();
            require(['css!assets/front/css/application/news-last']);
        </script>
    </section>