1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- {% macro recursivePages(amount, page, page1, page2) %}
- {% import _self as self %}
- {% set index = amount - 1 %}
- {% if index >= 0 %}
- {% set random_utilite = random(page.find('/projets').children) %}
- {% set p = random(random_utilite.children) %}
- {% if not page1 %}
- {% if p == page %}
- {% set index = amount + 1 %}
- {{ self.recursivePages(index, page) }}
- {% else %}
- {% include 'partials/projet_card.html.twig' with { p } %}
- {{ self.recursivePages(index, page, p) }}
- {% endif %}
- {% elseif not page2 %}
- {% if p == page or p == page1 %}
- {% set index = amount + 1 %}
- {{ self.recursivePages(index, page, page1) }}
- {% else %}
- {% include 'partials/projet_card.html.twig' with { p } %}
- {{ self.recursivePages(index, page, page1, p) }}
- {% endif %}
- {% elseif not page3 %}
- {% if p == page or p == page1 or p == page2 %}
- {% set index = amount + 1 %}
- {{ self.recursivePages(index, page, page1, page2) }}
- {% else %}
- {% include 'partials/projet_card.html.twig' with { p } %}
- {% endif %}
- {% endif %}
- {% endif %}
- {% endmacro %}
- {% import _self as self %}
- <div id="related-pages">
- <hr>
- <h3>Voir aussi</h3>
- <div id="related-grid">
- {% set relatedAmount = 3 %}
- {{ self.recursivePages(relatedAmount, page) }}
- </div>
- <p><a href="{{ page.parent.parent.url }}">Retour à la liste des projets</a></p>
- </div>
|