Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

Order by number of childrens

Started by Rea 9 years ago · 0 replies · 655 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, 4 weeks ago
4 469 2 weeks ago
Themes & Styling · by johan thomas, 5 years ago
1 799 3 weeks ago
Themes & Styling · by stuart young, 2 months ago
3 656 2 months ago
Themes & Styling · by Sebadamus, 3 months ago
5 677 2 months ago
Themes & Styling · by martynfoster735, 3 months ago
1 640 3 months ago