taxonomylist.html.twig 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. {% set taxlist = children_only is defined ? taxonomylist.getChildPagesTags() : taxonomylist.get() %}
  2. {% macro pageLinkName(text) %}
  3. {{ text|lower|replace({' ':'_', 'é':'e'}) }}
  4. {% endmacro %}
  5. {% import _self as macro %}
  6. {% for tax,value in taxlist[taxonomy] %}
  7. <ul>
  8. <span class="cat">{{ tax }}</span>
  9. {% set options = { items: {'@taxonomy': {'category': tax} } } %}
  10. {% set my_collection = page.collection(options) %}
  11. {% for i in my_collection %}
  12. {% if i.media.images|first %}
  13. <li class="{{i.parent.folder}}">
  14. <a id="{{i.parent.folder}}" href="{{i.url}}">{{i.title}}
  15. {% set images = i.media.images|slice(0,1) %}
  16. {% for image in images %}
  17. {% set services_image = image.derivatives(320,1600,300).sizes('(max-width:26em) 100vw, 50vw').html(i.title) %}
  18. <div class="img">
  19. {{services_image}}
  20. </div>
  21. {% endfor %}
  22. </a> /
  23. </li>
  24. {% endif %}
  25. {% endfor %}
  26. </ul>
  27. {% endfor %}