templates/blog/layouts/right-sidebar.html.twig line 1

Open in your IDE?
  1. {% set shouldPaginate = 0 %}
  2. <section class="blog-page pad-tb">
  3. <div class="container">
  4. <div class="row">
  5. <div class="col-lg-8">
  6. <div class="pr--100">
  7. {% for data in posts %}
  8. {% if data.content.blocks and data.getPublishedAt %}
  9. {% set shouldPaginate = shouldPaginate + 1 %}
  10. {% if data.content.blocks[0].type is same as("image") %}
  11. {% set image = data.content.blocks[0].data.file.url %}
  12. {% else %}
  13. {% set image = "null" %}
  14. {% endif %}
  15. {% include('partials/card/blog-card-bg.html.twig') with {
  16. title: data.title ,
  17. url: path('blog_post' , {
  18. slug: data.slug ,
  19. }) ,
  20. image: image,
  21. author: "admin",
  22. paragraph: data.content.blocks|filter(block => block.type == "paragraph")|map(block => "#{block.data.text}")|join(" "),
  23. categories: data.categories.unwrap
  24. } %}
  25. {% endif %}
  26. {% endfor %}
  27. {% if shouldPaginate is not same as(0) %}
  28. {{ pagerfanta(posts) }}
  29. {% endif %}
  30. </div>
  31. </div>
  32. {% include('partials/_sidebar.html.twig') %}
  33. </div>
  34. </div>
  35. </section>