actualites.html.twig 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. {% extends 'partials/base.html.twig' %}
  2. {% block content %}
  3. <div class="post_bottom columns large-12">
  4. <div class="row">
  5. {% set top_name = page.header.top %}
  6. {% if top_name != "/actualites" %}
  7. <div class="columns small-12 recent-posts">
  8. <div class=" row ">
  9. <div class="columns large-12 thumb_news top">
  10. {% set top_page = page.find(top_name) %}
  11. {% set source = top_page.header.media_thumbnail %}
  12. {% if source != null%}
  13. {% set info = "url('"~top_page.url~"/"~source~"')" %}
  14. {% endif %}
  15. <a style="background: {{ info }} rgb( 233, 77, 26);" href="{{ top_page.url }}">
  16. <div class="row">
  17. <div class="columns large-8 align-self-bottom">
  18. <mark>{{ top_page.title }}</mark>
  19. <span class="tag" ><span>{{ top_page.header.taxonomy.tag|first }}</span></span>
  20. </div>
  21. </div>
  22. </a>
  23. </div>
  24. </div>
  25. </div>
  26. {% endif %}
  27. {% for post in page.collection %}
  28. {% set source = post.header.media_thumbnail %}
  29. {% if source != null %}
  30. {% set info = post.url~"/"~source %}
  31. {% else %}
  32. {% set info = null %}
  33. {% endif %}
  34. {% if top_page.title != post.title %}
  35. <div class=" columns large-12 medium-12 medium-offset-0 small-8 small-offset-2 recent-posts">
  36. <div class=" row ">
  37. <div class="columns large-12 ">
  38. <a style="background: rgb( 233, 77, 26);" href="{{ post.url }}">
  39. <div class="row">
  40. <div class="columns small-4">
  41. <img src="{{ info }}" alt="">
  42. </div>
  43. <div class="columns small-7 small-offset-0 align-self-middle">
  44. <mark>{{ post.title }} - {{ post.header.publish_date|date("d/m/Y") }}</mark>
  45. <span class="tag" ><span>{{ post.header.taxonomy.tag|first }}</span></span>
  46. <br>
  47. <p style="color:black;">
  48. {{post.content|truncate(260, true)|raw|striptags }}
  49. </p>
  50. </div>
  51. </div>
  52. </a>
  53. </div>
  54. </div>
  55. </div>
  56. {% endif %}
  57. {% endfor %}
  58. </div>
  59. {% if config.plugins.pagination.enabled and page.collection.params.pagination %}
  60. {% include 'partials/pagination.html.twig' with {'base_url':page.url, 'pagination':collection.params.pagination} %}
  61. {% endif %}
  62. </div>
  63. {% endblock %}