Classement entre sections et pages #14

Merged
vincent merged 4 commits from classement into main 2022-09-28 14:42:42 +00:00
Showing only changes of commit f8b5a2e1ba - Show all commits

View file

@ -3,6 +3,45 @@
{% set sec = get_section(path=sec) %}
{% set maxlevel = hierarchy | length %}
{# Ici on regarde si toutes les sous-sections et pages contenues ont #}
{# une variable weight_custom #}
{% set temoin = true %}
{% set liste = [] %}
{% if sec.subsections %}
{% for s in sec.subsections %}
{% set s_temp = get_section(path=s) %}
{% if not s_temp.extra.weight_custom %}
{% set_global temoin = false %}
{% else %}
{% set_global liste = liste | concat(with=s_temp) %}
{% endif %}
{% endfor %}
{% endif %}
{% if sec.pages %}
{% for p in sec.pages %}
{% if not p.extra.weight_custom %}
{% set_global temoin = false %}
{% else %}
{% set_global liste = liste | concat(with=p) %}
{% endif %}
{% endfor %}
{% endif %}
{# Si toutes les sous-sections et pages ont une variable weight_custom, #}
{# on classe selon elle. Sinon, on utilise la méthode classique. #}
{% if temoin %}
// classer ici
{% else %}
{% if sec.subsections %}
{% for s in sec.subsections %}
{% set p = get_section(path=s) %}
@ -44,6 +83,7 @@
</div>
{% endfor %}
{% endif %}
{% endif %}
{% endmacro navsection %}
{% macro navmenu(current) %}