Best practice for a blog with 2 levels of categories

Hey there

I’ve planned to build some kind of blog/helpsection with multiple category levels and i’m wondering whats the best approach to get there.

The structure should be be something like this:
Blog
-General tips
–Tips and tricks
—Article 1
—Article 2
—Article 3
–Manage your account
—Article 4
—Article 5

-For admins
–Setup
—Article 6
—Article 7
–Manage users
—Article 8
—Article 9

First level (Blog)

  • Show search field (to search articles from all subcategories)
  • Show first level categories overview (General tips, For admins,…)
  • Show featured articles with articles from all subcategories

Second level (General tips, for admins, …)

  • show all articles grouped by third level categories (tips and tricks, manage your account, …)

Articles

  • show actual article content

I thought about doing a blog page that just lists the subpages, and within the subpages, I would just show all the articles which could have tags or a custom field for the second level category. However I found out, that then it’s probably not possible to search over all articles or to make something as a featured articles on the first level page.
I also had at look on how the cookbook was built, because it has categories and “new”, but i didn’t really figure it out. i guess its not quite the same, because they are not multilevel.

what would be the best practice to solve this?

I’d say it depends on the number of articles and what would be easier to handle for editor. A tree structure is probably the better option if you expect to have hundreds or thousands of articles.

You can use a flat articles structure, i.e. all articles are subfolders of blog and then attach a main category and a subcategory and later filter by these categories (for example using routes).

Or you could set up the main (first level) categories as subpages of blog, and then create all articles as subpages of these first level categories.

For search, it doesn’t really matter, you can search through either all articles or only through those of a given first level category.

thanks for your reply!

I probably go for the first level categories as subpages of blog when it does not matter for search. I expect that it will be rather 100 then 10 articles so as you said it will be probably easier to handle for the editor this way.

is there a possibility though to show the featured articles on the blog site?

Yes, of course. The only difference between all in the blog folder or stuff in subfolders is how you build your collection that you then filter.

$articles = page('blog')->grandChildren()->listed()->filterBy('featured', true);

awesome, thank you! :heart_eyes: