kiltedup - 1 year ago


Trying to use the Pages plugin function 'structure'.

Issue I'm having is that regardess of what I pass as the option for 'root', the output is the entire page structure of the site.

End result I'm looking for - say you are on a child page, structure will return all other child pages of the current pages parent.

Anyone used this successfully?


adnan - 1 year ago

If I understood your question correctly, try the parent option,

{{ structure().parent(page().parent).listClass('nav navbar-nav navbar-right').render()|raw }}

ryanthompson - 1 year ago

@adnan there is also a root option which you can send a page instance / path string:

Waiting to release pages 2.2 in order to write docs on it..

kiltedup - 1 year ago

Thanks for the replies.

I was using the root option with a path string - turned out the issue was simply that there was no leading '/' on the string. Without that the entire tree was returned.