relatedpages.html.twig 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <div id="related-pages">
  2. <hr>
  3. <h3>Voir aussi</h3>
  4. <div id="related-grid">
  5. {% set category = random(page.taxonomy.category) %}
  6. {% set p = random(taxonomy.findTaxonomy({'category': category}))%}
  7. {% if p == page %}
  8. {% set category = random(page.taxonomy.category) %}
  9. {% set p = random(taxonomy.findTaxonomy({'category': category}))%}
  10. {% if p == page %}
  11. {% set category = random(page.taxonomy.category) %}
  12. {% set p = random(taxonomy.findTaxonomy({'category': category}))%}
  13. {% if p == page %}
  14. {% set category = random(page.taxonomy.category) %}
  15. {% set p = random(taxonomy.findTaxonomy({'category': category}))%}
  16. {% endif %}
  17. {% endif %}
  18. {% endif %}
  19. {% include 'partials/projet_card.html.twig' %}
  20. {% set p = random(page.parent.children) %}
  21. {% if p == page or p == related_category_page %}
  22. {% set p = random(page.parent.children) %}
  23. {% if p == page or p == related_category_page %}
  24. {% set p = random(page.parent.children) %}
  25. {% if p == page or p == related_category_page %}
  26. {% set p = random(page.parent.children) %}
  27. {% endif %}
  28. {% endif %}
  29. {% endif %}
  30. {% include 'partials/projet_card.html.twig' %}
  31. {% set random_utilite = random(page.find('/projets').children) %}
  32. {% set p = random(random_utilite.children) %}
  33. {% if p == page or p == related_utilite_page or p == related_category_page %}
  34. {% set random_utilite = random(page.find('/projets').children) %}
  35. {% set p = random(random_utilite.children) %}
  36. {% if p == page or p == related_utilite_page or p == related_category_page %}
  37. {% set random_utilite = random(page.find('/projets').children) %}
  38. {% set p = random(random_utilite.children) %}
  39. {% if p == page or p == related_utilite_page or p == related_category_page %}
  40. {% set random_utilite = random(page.find('/projets').children) %}
  41. {% set p = random(random_utilite.children) %}
  42. {% endif %}
  43. {% endif %}
  44. {% endif %}
  45. {% include 'partials/projet_card.html.twig' %}
  46. </div>
  47. </div>