Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

Basic ordering doesn't work

Started by Muut Archive 10 years ago · 1 replies · 458 views
10 years ago

The children of my collection are listed in title order, not in the specified order.

I have a collection defined by

YAML
content:
    items: 
       '@self.children'
order:
    by: header.ref
    dir: asc

The children have a ref variable in the front matter, eg
ref: Ber 1

I want the children listed in order of the ref variable, so my template says:

TWIG
    {% for child in page.collection %}
        <li>{{ child.header.ref }} :

But the list comes out in title order, not ref order. What's wrong? I'm stuck.

10 years ago

Ooops. Mucked up my yaml. Fixed now. Apologies for time-wasting!

Suggested topics

Topic Participants Replies Views Activity
Archive · by Muut Archive, 10 years ago
1 673 1 week ago
Archive · by Deleted User, 9 years ago
0 3043 9 years ago
Archive · by Muut Archive, 9 years ago
2 1983 9 years ago
Archive · by Muut Archive, 9 years ago
2 5336 9 years ago
Archive · by Muut Archive, 9 years ago
1 4134 9 years ago