How to order a blog list by a header field?

More help please. I am trying to order a blog list by a header field.

Option 1.
I have ‘brand:’ in the header so tried:

        by: header.brand


Validation failed: 
Invalid input in "Order By"

Maybe as ‘brand;’ is page specific?

Option 2
I also have brand in the taxonomy but this produced the same result:

            by: header.taxonomy.brand

GRAV documentation says:

header.x The order based on any page header field. i.e. header.taxonomy.year. Also a default can be added via a pipe. i.e. header.taxonomy.year|2015

What am I missing?

Thank you

Ian Russell

The first one seems fine. The second, I think, won’t give you what you want anyway.

Is brand at the top level of your YAML frontmatter hierarchy?

Does every page in the collection you are ordering have this header? If not, maybe try adding a default with a pipe as mentioned in the docs in your quote.

Thank you, hughbris.

In the end, using the Gantry admin pages without delving into the twig I could only get order: by: title to work ; folder behaved like default with numeric prefixes still attached.

I will think about storing all the pages in question without numeric prefixes and adopting a folder naming scheme to order the pages.

FWIW I echo a previous comment about the documentation being hard to follow in this area (how-to example needed for each option): Content order custom

Ian Russell