Show blog post in 2 Categories/Folders?

Hello everybody,

I am migrating my personal blog currently to Grav and so far I found that the “Clean Blog” Theme fits my style (Clean and simple), I installed the skeleton and upgraded Grav, Plugins and the theme itself via the Admin Panel, migrating the posts itself wasn’t an issue at all which is done already, but I could use a little help for the nav-menu.

The current Test-structure is something like this:
image

Which is fine so far. Everything shows up on the nav-bar with all the pages.

But how can I accomplish that the pages from the categories are shown at the /home folder (Start page) aswell?

I tried to read about taxonomy, but can’t get it working. Maybe I do something wrong here.
From what I understand, I need to give the folders specific category names in the taxonomy section, like “Videos” and “Home” get videos and when I want to post I have to give the page itself the videos taxonomy aswell?

I found this answer here and tried to apply it, but somehow it still isn’t working as expected.
I guess it is because of the theme? or better said, because of the twig files?

What I found is 2 alternative ways:

  1. Copy every post I make and apply it to the Start/Home folder, so it will show up there too. But this will be a mess when there are plenty of posts.
  2. Make the Start/Home as an Item instead of Blog and make some kind of an list, like an overview of all posts, something like:
Date of Post - Link to post
Date of Post - Link to post
Date of Post - Link to post

The problem with this is, the Start/Home shows an date under the header name, which I don’t like.

So is there an “easy” way?
I don’t mind digging into the twig files and change them, just would need some assistance on what to look for.

So far I thought it is: Create Taxonomy categories (Videos, Photos, Series) and then assign every post I make to a category, then it’ll show on the nav-bar, but it seems a bit harder, since most blog themes are like 1 main category for ALL posts.

Thank you very much!

Your content organization is a little funky, but to answer your question specifically… Open up the ‘Clean Blog’ page (/home) in Admin and click the ‘Expert’ button so you can modify the frontmatter. The default frontmatter will look like:

title: 'Clean Blog'
menu: Home
subheading: 'A Clean Blog Theme by Start Bootstrap'
header_image: home-bg.jpg
content:
    items: '@self.children'
    order:
        by: date
        dir: desc
    limit: 4
    pagination: true
pagination: true

You want to change the content: as such:

title: 'Clean Blog'
menu: Home
subheading: 'A Clean Blog Theme by Start Bootstrap'
header_image: home-bg.jpg
content:
    items:
      - @self.children
      - @page: /photos
      - @page: /videos
      - @page: /series
    order:
        by: date
        dir: desc
    limit: 4
    pagination: true
pagination: true

Additionally, I noticed in your screenshot that ‘/photos/test’ page is set to ‘default’ template and ‘/videos/video-reviews’ page is set to ‘blog’ template. Since these pages are both children of a ‘blog’ page template they should be using the ‘item’ template.

Ah yes, forgot to change that, was just for “Test purposes” to show how I wanna organize it so you get an idea. Ofc, later the blog posts itself are items. :slight_smile:

Basically the /home will be emptied later (It is just from the sekelton), the /home will be for all the blog post, beside the categories itself, just want to make /home shows me the latest posts.

Awesome!
Thank you very much @andy ! Works!

1 Like