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 7 years ago · 1 replies · 555 views
7 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

7 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 Anna, 15 hours ago
1 46 8 hours ago
Support · by gtx, 1 week ago
4 227 2 days ago
Support · by Paul Hodges, 2 weeks ago
13 275 5 days ago
Support · by Anna, 3 weeks ago
9 334 1 week ago
Support · by TomW, 2 weeks ago
4 187 2 weeks ago