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

Submenu for specific page

Solved by Greet Peirelinck View solution

Started by Greet Peirelinck 8 years ago · 1 replies · 576 views
8 years ago

Hi,
I'm new to grav and looking for a way to add subpages of a particular parent-page (not the current page) in the sidebar of my layout.
Can someone point me in the good direction?
Thanks in advance

8 years ago Solution

I found the folowing solution that works for me.

TWIG
    `{% for page in page.find('/page/subpage').children()%}`
       `<a href="{{ page.url }}">{{ page.title }}</a><br>`
    `{% endfor %}`
👍 1
last edited 02/08/19 by Greet Peirelinck

Suggested topics

Topic Participants Replies Views Activity
Support · by Paul Hodges, 4 weeks ago
19 485 5 days ago
Support · by Lauw, 7 days ago
2 99 7 days ago
Support · by Anna, 3 weeks ago
4 426 1 week ago
Support · by gtx, 4 weeks ago
4 377 3 weeks ago
Support · by Anna, 1 month ago
9 484 3 weeks ago