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 · 493 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 BenLaKnet, 5 days ago
1 120 2 days ago
Support · by BenLaKnet, 1 week ago
5 194 2 days ago
Support · by kskt, 2 days ago
0 44 2 days ago
Support · by David Meissner, 3 days ago
0 43 3 days ago
Support · by David Meissner, 3 days ago
3 92 3 days ago