Skip to content
Grav 2.0 is officially stable. Read the announcement →
Themes & Styling

Order by number of childrens

Started by Rea 9 years ago · 0 replies · 595 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 stuart young, 2 weeks ago
3 251 2 weeks ago
Themes & Styling · by Sebadamus, 3 weeks ago
5 317 3 weeks ago
Themes & Styling · by martynfoster735, 4 weeks ago
1 310 4 weeks ago
Themes & Styling · by Justin Young, 1 month ago
1 348 1 month ago
Themes & Styling · by Slebeig, 2 months ago
4 474 2 months ago