templates/front/blocks/blog/block_content_bottom_proposition.twig line 1

Open in your IDE?
  1. {% set firstCategory = categories.0.category.id|default(null) %}
  2. {% set postsProposition = get_posts(4, 1, null, firstCategory) %}
  3. {% set i = 0 %}
  4. {% if postsProposition.items|length > 1 %}
  5.     <section class="container main-blog mb-5 pb-5 pt-4">
  6.         <div class="row mb-5 pb-5">
  7.             <h2 class="fw-bold f-40 mt-2 mb-5 text-center">Mogą Ci się również spodobać</h2>
  8.             {% for post in postsProposition.items|default([]) %}
  9.                 {% if actualPostId != null and actualPostId != post.id and i < 3 %}
  10.                     <div class="col-md-4 col-12 blog-item my-3 my-md-0">
  11.                         <a href="{{ post.page.translations.pl.url|default('#') }}">
  12.                             <div class="zoom"><img src="{{ (CONST_IMAGE_URL ~ post.postPreview.fileName|default(''))|imagine_filter('full') }}" alt="">
  13.                                 <p>{{ post.translations.pl.head|default('') }}</p>
  14.                                 {% if post.isNews|default(false) %}
  15.                                     <div class="bg-secondary text-white new">new</div>
  16.                                 {% endif %}
  17.                             </div>
  18.                         </a>
  19.                     </div>
  20.                     {% set i = i + 1 %}
  21.                 {% endif %}
  22.             {% endfor %}
  23.         </div>
  24.         <div class="text-center">
  25.             <a href="{{ blogUrl != '' ? (blogUrl) : '#' }}" class="btn btn-dark">czytaj więcej</a>
  26.         </div>
  27.     </section>
  28. {% endif %}