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 · 442 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 52 9 hours ago
Support · by Anna, 3 days ago
2 59 11 hours ago
Support · by Justin Young, 12 hours ago
1 30 12 hours ago
Support · by Duc , 1 week ago
2 65 5 days ago
Support · by Colin Hume, 1 week ago
2 56 5 days ago