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

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Content & Markdown

Collections - indented based on folder hierachy

first-time

Solved by pamtbaau View solution

Started by Al 2 years ago · 1 replies · 223 views
2 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 94 8 months ago
Content & Markdown · by Ton Haarmans, 1 year ago
10 184 1 year ago
Content & Markdown · by Jan L'Am, 1 year ago
4 146 1 year ago
Content & Markdown · by Leonardo, 1 year ago
3 60 1 year ago
Content & Markdown · by belthasar, 1 year ago
4 254 1 year ago