Quick Organization Question!

Hey everyone! I’ve finally made my way back to Kirby and I’m thrilled. I’m working on a project that will have multiple categories of posts with multiple types of layouts and styling requirements.

What I’d like to do is have the following structure within my project :

/Food

  • post 1
  • post 2
    /Fun
  • post 1
  • post 2

INDEX PAGE
Section 1 shows the most recent post GLOBALLY, meaning it will pull the most recent post from all all categories.

Section 2a — will show the rest of the posts in a list with thumbs

or

Section 2b — will show the 3 most recent posts from each /Food, /Fun, /Etc categories.

So with that said, is there a way to process this through the loop and through the current structure I’m thinking about here?

I know I could always use filters etc to filter each TAG without the category folders. If I choose to do that, how do I customize the styling for each filter? Layouts. I hope I’m being clear and I look forward to your guidance!

Scott

You can achieve this no matter if you use a flat structure (all posts in one parent), or if you create category pages and the posts as subpages of those categories pages.

I guess in your example, food and fun are categories on the same level, not quite clear and also not clear if they share are parent or are located directly in /content.

Let’s say your structure is this

content/
  blog/
    food/
      post-one
      post-two
    travel/
      post-one
      post-two
    fun/
      post-one

The you can fetch all pages under blog with

$allPosts = page('blog')->index();

This flat collection can then be sorted by date to get the most recent ones.

$allTravel = page('blog/travel')->children()

Would get all posts of the given category. Again, they can be sorted or filtered or whatever.

Don’t know what you mean with styling, but for one thing, but the subpages of each category can have posts with different blueprints/templates.