You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
2.9 KiB
63 lines
2.9 KiB
{% set current_path = template_path ~ '/modules/blog/components/featured-slider' %}
|
|
|
|
{% if featured %}
|
|
<div class="home-swp">
|
|
<div class="home-swp__btn">
|
|
<button class="home-swp__btn-prev">
|
|
<img src="{{ current_path }}/assets/img/swp-prev.svg" alt="">
|
|
</button>
|
|
<button class="home-swp__btn-next">
|
|
<img src="{{ current_path }}/assets/img/swp-next.svg" alt="">
|
|
</button>
|
|
</div>
|
|
<div class="swiper">
|
|
<div class="swiper-wrapper">
|
|
|
|
{% for _post in featured %}
|
|
{% set bg_classes = ['bg-yellow', 'bg-green', 'bg-violet'] %}
|
|
{% set bg_class = bg_classes[loop.index0 % 3] %}
|
|
|
|
<div class="swiper-slide">
|
|
<div class="home-card {{ bg_class }}">
|
|
<a href="{{_post.link}}" class="home-card__img">
|
|
<img src="{{_post.thumbnail.src}}" alt="{{_post.thumbnail.alt}}">
|
|
</a>
|
|
|
|
<div class="home-card__content">
|
|
<a href="{{_post.link}}" class="home-card__content-title">{{_post.name}}</a>
|
|
<p class="home-card__content-description">{{_post.excerpt}}</p>
|
|
<div class="home-card__content-body">
|
|
<ul class="home-card__content-body__alerts">
|
|
{% for category in _post.categories %}
|
|
<li>
|
|
<a href="{{ category.link }}">{{ category.name }}</a>
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
<div class="home-card__content-body__day">{{_post.date}}</div>
|
|
<div class="home-card__content-body__time">{{ function('pll_e', 'время чтения') }}: {{_post.reading_time}}</div>
|
|
<div class="home-card__content-body__data">
|
|
<div>
|
|
<img src="{{ current_path }}/assets/img/heart-grey.svg" alt="">
|
|
<span>{{ function('get_post_likes_count', _post.ID|default(0)) }}</span>
|
|
</div>
|
|
<div>
|
|
<img src="{{ current_path }}/assets/img/msg-grey.svg" alt="">
|
|
<span>{{ _post.get_comments_number }}</span> </div>
|
|
{% if _post.get_author_name %}
|
|
<div class="logo">
|
|
<img class="main-img" src="{{_post.get_author_img}}" alt="">
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
<a href="{{_post.link}}" class="home-card__content-body__link">{{ function('pll_e', 'читать статью') }}</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{% endif %} |