categories.html.twig 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. {% extends 'partials/base.html.twig' %}
  2. {% set bodyclass = "categories" %}
  3. {% block content %}
  4. <nav class="categories">
  5. {% include 'partials/tagslist.html.twig' with {'base_url':"/categories/", 'taxonomy':'tag', 'display':'inline'} %}
  6. </nav>
  7. {% set contents = page.collection %}
  8. {% set taxlist = taxonomylist.get() %}
  9. <div id="categories-content" class="grid">
  10. {% for tax,value in taxlist['client'] %}
  11. {% set posts = taxonomy.findTaxonomy({'client':tax}) %}
  12. {% set disposts = {} %}
  13. {% set i = 0 %}
  14. {% for p,v in posts %}
  15. {% if v in contents %}
  16. {% set disposts = disposts|merge({('_'~(v.date|date("Y"))~'_'~i):v}) %}
  17. {% endif %}
  18. {% set i = i+1 %}
  19. {% endfor %}
  20. {{ dump(disposts) }}
  21. {% if disposts|length %}
  22. <section class="client-block client-block-text grid-block columns large-3 medium-6 small-12">
  23. <h3>{{ tax }}</h3>
  24. <ul>
  25. {% for key,post in disposts|ksort|reverse %}
  26. <li class="project">
  27. {% include 'partials/projet-block.html.twig' with {'page':post,'display':'text',"key":key} %}
  28. </li>
  29. {% endfor %}
  30. </ul>
  31. </section>
  32. {% endif %}
  33. {% endfor %}
  34. </div>
  35. {% endblock %}