Putting posts in categories

Hey all,

what I’m trying to achieve is saving posts/articles into categories. I put in a “select” field in my plueprint but how do I manage to finally put them into categories? I can not seem to find a solution to categories in the docs although setting up the blueprints for this task is explained.

Really don’t know how to get that.

Well, you don’t really put posts into a category, the posts are saved where you create them as described in the docs: Adding content.
What you can do is assign them a category. Then you can display lists of posts with a particular category by filtering them. A way to achieve this is described in the Blog tutorial: tags.

Okay, so categories are independent from the folders the content is stored in, right?

But what of i’d like to have a clean permalink after filtering like work/webdesign or work/typography for example?

Yes, categories can be used just like tags, just named differently, and they are independent of how your content is organized. You may want to have a look at this post about how to remove the “tag” from the url and get nice and clean ones by using routes How to cleanup/remove the (tag:) from url.

Of course, if you prefer to have folders for your categories, that would be another option to organize your content and more “putting content into categories”. There are many ways to achieve results in Kirby :smiley: It wouldn’t make sense if you were to assign more than one category to a post, though.

From your example URLs, I’ll make a guess and suppose you have a portfolio with a page like “Work” and all your works as subpages of “Work”.
Two ways (among others) to achieve what you want:

  • use tags (with the tag field) and do as described in the Solutions: Tags. The section titled “Controlling the filter by URL” is what you’re looking for. Best if a work can be in multiple categories.

  • keep the select field and use routing to redirect work/whatever to the appropriate works list. Suits well if works only have one category.

Thank you! That helps a lot.

I guess i will stick to the “categories by folders” way. new question coming up next :blush:

The tags page on the docs has moved to https://getkirby.com/docs/cookbook/tags