templates/front/blocks/block-post-content.twig line 1

Open in your IDE?
  1. {% set page = _parent.entity %}
  2. {% set lastPosts = get_posts(6, 1, null) %}
  3. {% set actualPostId = page.post.id %}
  4. {% set settings = get_settings_data() %}
  5. {% set categories = page.post.categories.toArray|default([]) %}
  6. {% set countCategories = categories|length %}
  7. {% set blogUrl = get_blog_url(app.request.locale|default('pl')) %}
  8. <section class="parent-container container-fluid py-5">
  9.     <div class="row justify-content-around pb-5">
  10.         <div class="col-lg-8 col-xl-7 col-xxl-6 blog-content">
  11.             <p class="text-center">
  12.                 {% for postCategory in categories %}
  13.                     {% if postCategory.category.page.isPublished|default(false) %}
  14.                         {% set categoryId = postCategory.category.id|default(null) %}
  15.                         {% set category = categoryId is null ? '' : ('?category=' ~ categoryId) %}
  16.                         <a href="{{ blogUrl ~ category|default('#') }}">{{ postCategory.category.translations.pl.categoryName|default('') }}</a>
  17.                     {% else %}
  18.                         {{ postCategory.category.translations.pl.categoryName|default('') }}
  19.                     {% endif %}
  20.                 {% endfor %}
  21.             </p>
  22.             <h1 class="my-3 text-center f-48 fw-bold">{{ section.translations.pl.title|default(null) is null ? page.post.translations.pl.head|default('') : section.translations.pl.title|default('') }}</h1>
  23.             <p class="text-center">{{ date_format(section.createdAt|default(null)) }}</p>
  24.             <div class="row justify-content-center mt-3 mb-5">
  25.                 <div class="col-xxl-8 col-xl-8 col-lg-7 col-12 col-sm-5 px-xxl-0">
  26.                     <div class="zoom"><img src="{{ section.image.fileName|default(null) is null ? (CONST_IMAGE_URL ~ page.post.postPreview.fileName|default(''))|imagine_filter('full') : (CONST_IMAGE_URL ~ section.image.fileName|default(''))|imagine_filter('full') }}" alt=""></div>
  27.                 </div>
  28.             </div>
  29.             {{ section.translations.pl.htmlContents.first|default('')|raw }}
  30.         </div>
  31.         <div class="col-lg-4 col-xl-3 col-xxl-2 blog-search py-4 text-center pb-5">
  32.             <div class="blog-text-sticky pt-5 mt-5">
  33.                 <div class="d-flex search-wrapper mx-auto">
  34.                     <input type="search" placeholder="wyszukaj" class="bg-grey" id="searchPhrase">
  35.                     <button type="submit" class="loupe bg-grey relative-loupe" id="searchBtn">
  36.                         <img src="{{ asset('assets/img/lupa-icon.svg') }}" alt="">
  37.                     </button>
  38.                 </div>
  39.                 {% if lastPosts.items|length > 1 %}
  40.                     <p class="fw-bold f-30 mt-5 pb-0">ostatnie wpisy</p>
  41.                 {% endif %}
  42.                     {% set i = 0 %}
  43.                     {% for post in lastPosts.items %}
  44.                         {% if actualPostId != null and actualPostId != post.id and i < 5 %}
  45.                             <p>
  46.                                 <a href="{{ post.page.url|default }}">{{ post.translations.pl.head|default }}</a>
  47.                             </p>
  48.                             {% set i = i + 1 %}
  49.                         {% endif %}
  50.                     {% endfor %}
  51.                 <div class="text-center mt-4">
  52.                     <a href="{{ blogUrl|default('#') }}" class="btn btn-dark btn-sm">czytaj wiÄ™cej</a>
  53.                 </div>
  54.                 {% if settings is not null %}
  55.                     {% if settings.instagram is not null and settings.instagram != '' %}
  56.                         <div class="position-relative insta-container">
  57.                             <p class="text-uppercase text-end pb-0 follow-us">follow us</p>
  58.                             <a href="{{ settings.instagram|default('#') }}" target="blank"><img src="{{ asset('assets/img/instagram.svg') }}" alt="" class="instagram"></a>
  59.                         </div>
  60.                     {% endif %}
  61.                 {% endif %}
  62.             </div>
  63.         </div>
  64.     </div>
  65. </section>
  66. {% include 'front/blocks/blog/block_content_menu.twig' %}
  67. {% include 'front/blocks/blog/block_content_bottom_proposition.twig' %}