@taxonomy: Array to String Conversion error

I have switched to in a fresh load of “grav-skeleton-bootstrap4-site”.

Why does @taxonomy give an Array to String Conversion error with the following front matter:

content:
    items: 
        '@taxonomy':
        tag: [photography,text]
    order:
        by: date
        dir: desc
    limit: 5
    pagination: '1'

Thank you.

Ian Russell

Your YAML is bad. Whenever you get problems like this, pull up a YAML linter/validator. In this case, tag isn’t indented properly.

All that said, read the docs on Page Collections. A simple '@taxonomy.tag': [photography, text] will also do.

Thank you, but the following still gives an Array to String conversion error:

content:
items: 
    '@taxonomy':
        tag: [photography,text]
order:
    by: date
    dir: desc
limit: 5
pagination: '1'

and so does this:

content:
items: 
    '@taxonomy.tag': [photography, text]
order:
    by: date
    dir: desc
limit: 5
pagination: '1'

I am wondering if there is problem with the latest version of Grav or Gantry.

Ian Russell

This issue is resolved now - incompatible item selector, I think.

The grav-skeleton-bootstrap4-site has Children instead of @self.children in the options. Maybe this is shorthand but I went back to my website and got it working.

To repeat a note from my other thread, using taxonomy to select pages can be confusing before you have worked out how to do it!

Sometimes my selectors in the front matter and the options tab were out of step. When there is a problem I start with one and check the other.

Thank you

Ian Russell