Skip to content
Grav 2.0 is officially stable. Read the announcement →
Content & Markdown

Collections - indented based on folder hierachy

first-time

Solved by pamtbaau View solution

Started by Al 3 years ago · 1 replies · 408 views
3 years ago

I'd like to show a brief collection on one page. the collection being a concise list of title and url for each of it's children. each level is indented like:

  • folder 1
    -- folder 1, page 1
    -- folder 1, page 2
    -- folder1 subfolder 1
    --- folder1 subfolder 1, page 1
  • folder 2
    -- folder 2 page 1
  • folder 3

I tried loop.index (in my twig) as a means to determine depth, but that doesnt work as it increases all the time. I need a 'depth' variable, but cant find any not of this anywhere, so I think I am looking for the wrong word/s

Suggested topics

Topic Participants Replies Views Activity
Content & Markdown · by Jochen, 8 months ago
6 350 8 months ago
Content & Markdown · by Ton Haarmans, 1 year ago
10 376 1 year ago
Content & Markdown · by Jan L'Am, 1 year ago
4 309 1 year ago
Content & Markdown · by Leonardo, 1 year ago
3 228 1 year ago
Content & Markdown · by belthasar, 2 years ago
4 496 2 years ago