home.html.twig 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. {% extends 'partials/base.html.twig' %}
  2. {% set collection = page.collection() %}
  3. {% set blog = page.find(header_var('blog_url')|defined(theme_var('blog-page'))) %}
  4. {% set show_breadcrumbs = header_var('show_breadcrumbs', [page, blog])|defined(true) %}
  5. {% set show_sidebar = header_var('show_sidebar', [page, blog])|defined(true) %}
  6. {% set show_pagination = header_var('show_pagination', [page, blog])|defined(true) %}
  7. {% block stylesheets %}
  8. {{ parent() }}
  9. {% endblock %}
  10. {% block javascripts %}
  11. {{ parent() }}
  12. {% endblock %}
  13. {% block body %}
  14. <section id="body-wrapper" class="section">
  15. {% embed 'partials/layout.html.twig' with {blog: page} %}
  16. {% block item %}
  17. {% set first_event = { items: {'@page.children':'/whats-on/exhibitions/current-upcoming'} } %}
  18. {% set Efirst = page.collection(first_event) %}
  19. {% set options = { items: {'@root.descendants':''}} %}
  20. {% set options2 = { items: {'@page.modular':'/news/news/'}} %}
  21. {% set options3 = { items: {'@page.children':'/residence/current-upcoming'}} %}
  22. {% set collection1 = page.collection(options) %}
  23. {% set collection2 = page.collection(options2) %}
  24. {% set collection3 = page.collection(options3) %}
  25. {% set mergeCollect12 = collection1.merge(collection2) %}
  26. {% set mergeCollectTT = mergeCollect12.merge(collection3).order('date', 'desc') %}
  27. {% for siblings in Efirst %}
  28. {% if siblings.header.topH == true %}
  29. {% include 'partials/blog-list-item.html.twig' with {blog: page, page: siblings} %}
  30. {% endif %}
  31. {% endfor %}
  32. {% set count = 0 %}
  33. {% for siblings in mergeCollectTT %}
  34. {% if siblings.template == 'events' and siblings.header.topH != true or siblings.template == 'artistes' or siblings.template == 'modular/news' %}
  35. {% if siblings.header.date|date('Ymd') >= "now"|date('Ymd') or siblings.header.date_end == true and siblings.header.date_end|date('Ymd') >= "now"|date("Ymd") %}
  36. {% set count = count + 1 %}
  37. {% endif %}
  38. {% if count <= 5 %}
  39. {% if siblings.header.date|date('Ymd') >= "now"|date('Ymd') or siblings.header.date_end == true and siblings.header.date_end|date('Ymd') >= "now"|date("Ymd") %}
  40. {% include 'partials/blog-list-item.html.twig' with {blog: page, page: siblings} %}
  41. {% endif %}
  42. {% endif %}
  43. {% endif %}
  44. {% endfor %}
  45. {% endblock %}
  46. {% block sidebar %}
  47. {% if header.show_sidebar == true %}
  48. {% include 'partials/sidebar.html.twig' %}
  49. {% endif %}
  50. {% endblock %}
  51. {% endembed %}
  52. </section>
  53. {% endblock %}