Sort pages using PAGES_SORT_ATTRIBUTE only if explicitly defined.
This commit is contained in:
parent
8a80be0b78
commit
ac49889075
1 changed files with 3 additions and 6 deletions
|
@ -107,14 +107,11 @@
|
||||||
{% if pages or LINKS %}
|
{% if pages or LINKS %}
|
||||||
<nav>
|
<nav>
|
||||||
<ul class="list">
|
<ul class="list">
|
||||||
{% if PAGE_ORDER_BY -%}
|
{% if PAGES_SORT_ATTRIBUTE -%}
|
||||||
{% set PAGES_SORT_ATTRIBUTE = PAGE_ORDER_BY %}
|
{% set pages = pages|sort(attribute=PAGES_SORT_ATTRIBUTE) %}
|
||||||
{%- endif %}
|
|
||||||
{% if not PAGES_SORT_ATTRIBUTE -%}
|
|
||||||
{% set PAGES_SORT_ATTRIBUTE = 'title' %}
|
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{% if DISPLAY_PAGES_ON_MENU %}
|
{% if DISPLAY_PAGES_ON_MENU %}
|
||||||
{% for page in pages|sort(attribute=PAGES_SORT_ATTRIBUTE) %}
|
{% for page in pages %}
|
||||||
<li><a href="{{ SITEURL }}/{{ page.url }}{% if not DISABLE_URL_HASH %}#{{ page.slug }}{% endif %}">{{ page.title }}</a></li>
|
<li><a href="{{ SITEURL }}/{{ page.url }}{% if not DISABLE_URL_HASH %}#{{ page.slug }}{% endif %}">{{ page.title }}</a></li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
Loading…
Reference in a new issue