How to list taxonomy?

Mojn

I have failed my googling. In my default.md I got:

---
title: pageTitle
taxonomy: 
    tag: [tag1, tag2, tag3]
    category: Cat1
---

Which I hope is correct from when I read this page: Taxonomy | Grav Documentation and GitHub - getgrav/grav-plugin-taxonomylist: Grav TaxonomyList Plugin

But when I edit the page in Admin I end up with this:

---
title: pageTitle
taxonomy: 
    tag: 
        - tag1
        - tag2
        - tag3
    category: 
        - Cat1
---

I got the Lingonberry theme (v1.2.1), Taxonomy List plugin (v1.3.6) and Grav v1.7.48 and Admin v1.10.48 running.

So which one is correct and how can I make the taxonomy to look the same.

Many thanks
woollypigs

What is the problem? The format in md file? . Is your page working with both formats?

Please edit your post to use code blocks to paste your config. Currently thereā€™s no way to tell if formatting is wrong or something else

Mojn

the problem is that when I edit/create the default.md file in a text editor and enter this " tag: [tag1, tag2, tag3]" it works and show up happily. But if I log in and create a new post/file (default.md) via Grav Admin editor the tags get written like this ā€œtag: - tag1 - tag2 - tag3ā€

Which isnā€™t what is shown in the Grav documentation.

It should be done now, I hope it worked

This is an example of item in blog from Editorial theme demo page.

---
title: 'First item'
taxonomy:
    category:
        - featured
    tag:
        - tag1
---

It works fine. Iā€™m not understand what is the problem. The taxonomy could be shown in both formats without problem.

The main problem is that if I create the files ā€œmanuallyā€ and follow this page: Taxonomy | Grav Documentation

This is how the tags should be written

---
title: pageTitle
taxonomy: 
    tag: [tag1, tag2, tag3]
    category: Cat1
---

i tend to create the pages/blogs in a text editor and then FTP them up once Iā€™m online. And I would like my pages to look the same, easier to edit.

But if I log into the site via Grav Admin page and create a page/blogs there and use the options there to add tags I get this

---
title: pageTitle
taxonomy: 
    tag: 
        - tag1
        - tag2
        - tag3
    category: 
        - Cat1
---

Which isnā€™t what is shown in the Grav Documentation page that I linked above. It just confuses me and somewhat annoys me that my pages arenā€™t looking the same or follow the same ā€œrulesā€ with the regard to the layout.

Thanks

But then it is not a problem in itself, but the documentation of the Grav Taxonomy is incomplete and should include this .md file format

In that case you could send it to the Grav team through a PullRequest in the Documentation repository.

Mojn

Never done a PullRequest so a bit stumped there.

Do you know which ā€œversionā€ of the taxonomy is correct, so that I can make sure all my pages are following that. Donā€™t want to end up it not working in a future update.

Thanks

@woollypigs, these are just a different styles for sequences (block/flow ), both are valid. However, the ā€˜blockā€™ style is generally considered more readable, especially with longer data. Here is link to the yaml documentation.

1 Like

OK thanks.

Is there a way to get Grav to use the ā€˜blockā€™ style as I prefer that and have used it for nearly 500 posts already.

Or shall I just learn to live with it and create the new post in a text editor and FTP them into place, instead of using Grav editor. :roll_eyes: :stuck_out_tongue_winking_eye:

Thanks