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

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Themes & Styling

Order by number of childrens

Started by Rea 8 years ago · 0 replies · 486 views
8 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 Pedro M, 2 months ago
4 222 2 months ago
Themes & Styling · by Ian, 2 months ago
3 118 2 months ago
Themes & Styling · by Norbert, 2 years ago
11 481 3 months ago
Themes & Styling · by Lukáš Findeis, 3 months ago
0 72 3 months ago
Themes & Styling · by Sebadamus, 4 months ago
5 132 3 months ago