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.

Support

Submenu for specific page

Solved by Greet Peirelinck View solution

Started by Greet Peirelinck 7 years ago · 1 replies · 443 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 Thomas, 1 week ago
2 56 13 hours ago
Support · by Anna, 3 days ago
2 61 16 hours ago
Support · by Justin Young, 17 hours ago
1 32 17 hours ago
Support · by Duc , 1 week ago
2 66 5 days ago
Support · by Colin Hume, 1 week ago
2 59 5 days ago