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

Basic ordering doesn't work

Started by Muut Archive 9 years ago · 1 replies · 339 views
9 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.

9 years ago

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

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1336 9 years ago
Archive · by Muut Archive, 9 years ago
2 926 9 years ago
Archive · by Muut Archive, 9 years ago
2 4056 9 years ago
Archive · by Muut Archive, 9 years ago
1 2941 9 years ago
Archive · by Muut Archive, 9 years ago
3 1112 9 years ago