Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Content within Nested Folders

Started by Muut Archive 11 years ago · 4 replies · 499 views
11 years ago

I'm new to Grav and trying to set up a blog with the following organization, but I'm having trouble figuring out how to get the content to show up. I started with the blog skeleton, but would like my posts within nested folders:

YAML
 - 01.blog
  - blog.md
  - 2014
    - 05
      - random-thoughts
    - 06
    - 07

I've tried several different things in blog.md with the content:items option, but none of them display what I want. setting it to @self.children shows a blank 2014 post or any posts in the top level of the 01.blog folder, and setting @taxonomy.category: blog doesn't show anything. How can I list all posts within the folder and subfolders or can I not organize my files this way? Ideally I'd like to also create other pages such as a different taxonomies that use these files. Thanks!

11 years ago

Still no ideas on having a collection include nested items?

11 years ago

Looks like this one slipped through the cracks! @taxonomy should work, i'll have to do some testing... bbiab :)

11 years ago

Ok this totally works fine for me:

YAML
content:
    items: 
        @taxonomy.category: blog
    order:
        by: date
        dir: desc
    limit: 5
    pagination: true

All pages that have:

YAML
taxonomy:
    category: blog  

Show up in the blog list for me.

11 years ago

Thanks! I thought it might have had something to do with taxonomy but I think I was using it wrong and the pages weren't showing up. That works perfectly.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1336 9 years ago
Archive · by Muut Archive, 9 years ago
2 925 9 years ago
Archive · by Muut Archive, 9 years ago
2 4056 9 years ago
Archive · by Muut Archive, 9 years ago
1 2941 9 years ago
Archive · by Muut Archive, 9 years ago
3 1112 9 years ago