Hello,
To sum up what I need to do, I need to get the Parent ID of the current Document and output it into WayFinder as the Starting ID.
My WayFinder Call (Within Chunk):
[[!Wayfinder? &displayStart=`TRUE` &startId=`[[!getParent]]` ]]
My getParent Snippet:
<?php
$id = $resource->get('parent');
return $id;
My Resource Structure:
Parent
- Child
- Child
Parent
- Parent
-- Child
-- Child
-- Child
I am applying this to the Parent -> Parent -> Child Resources.
I need this because I have to use this WayFinder call through multiple Resources on multiple Contexts. So I cannot specify each individual startID in each individual Chunk or Resource.
Thank you!
[ed. note: last edited this post 14 years, 3 months ago.]
The web is our sandbox, so let's develop a castle.
you would need:
<?php
$id = $modx->resource->get('parent');
return $id;
but, you don't need a snippet for that at all.
You can do
[[!Wayfinder? &displayStart=`TRUE` &startId=`[[*parent]]` ]]
If you allways need the ultimateParent of the top level or any other level you can use the ultimateParent - snippet