Hello, thank you so much for the syntethic and precise post! I was wondering if you have time to share how to handle categories and category pages.
Thanks, Martino for reading the post! In order to handle categories, you have to create a new collection and create a new field with relation type widget (see links) in the blog collection.
.... collections: - name: "blog" label: "Blog" format: "json" folder: "assets/content/blog" create: true slug: "{{slug}}" editor: preview: true fields: - { label: "Title", name: "title", widget: "string" } - { label: "Publish Date", name: "date", widget: "datetime" } - { label: "Category", name: "category", widget: "relation", collection: "categories", searchFields: ["name"], valueField: "name", multiple: true, } - { label: "Body", name: "body", widget: "markdown" } - name: "categories" label: "Categories" folder: "assets/content/category" create: true slug: "{{slug}}" identifier_field: name fields: - { label: "Name", name: "name", widget: "string" } - { label: "Image", name: "image", widget: "image", required: false } - { label: "Description", name: "description", widget: "markdown" } .....
I hope this will help.
Great, thanks
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hello, thank you so much for the syntethic and precise post! I was wondering if you have time to share how to handle categories and category pages.
Thanks, Martino for reading the post!
In order to handle categories, you have to create a new collection and create a new field with relation type widget (see links) in the blog collection.
I hope this will help.
Great, thanks