Skip to content
Grav 2.1 is out: every page speaks Markdown. Read the announcement →

Order by number of childrens

Started by Rea 9 years ago · 0 replies · 621 views
9 years ago

How can i order by number of childrens?

ex:
{% for page in page.find('/blog').children.order( page.children|length ) %}
<a href="{{ page.url }}">{{ page.title|split(' ')|slice(0, 1)|join }} <sup>{{ page.children|length }}</sup></a>
{% endfor %}

need this
category<sup>10</sup>, category<sup>5</sup>, category<sup>2</sup>

Suggested topics

Topic Participants Replies Views Activity
Themes & Styling · by FrViPofm, 15 hours ago
1 29 2 hours ago
Themes & Styling · by stuart young, 1 month ago
3 480 1 month ago
Themes & Styling · by Sebadamus, 2 months ago
5 481 2 months ago
Themes & Styling · by martynfoster735, 2 months ago
1 460 2 months ago
Themes & Styling · by Justin Young, 2 months ago
1 490 2 months ago