I have a documents tree with 3 levels:
-L1
-L2
-L2
-L3
-L3
+L1
1. At L2 i display the L1 menu with Ditto as following code:
[[Ditto?&parents=[*parent*]
2.At L3 if want to display the L1 menu, i have to get id of grandfather of current document. fortunately getField snippet comes and is responsible for getting L1 id like this :
[!GetField?&field=`id` &parent=`1` &parentlevel=`2`!]
now, I combine 2 above technologies together :
[[Ditto?&parents=[!GetField?&field=`id` &parent=`1` &parentlevel=`2`!]]]
but ditto seems not recognize the id value returned from getField snippet.
give your suggestions!
try
[[Ditto?&parents=`[!GetField?&field=`id` &parent=`1` &parentlevel=`2`!]`]]
or
[!Ditto?&parents=`[[GetField?&field=`id` &parent=`1` &parentlevel=`2`]]`!]
you can also use the UltimateParent-snippet instaed of GetField and why not wayFinder for the menu?
Bruno
Just for testing I know this is taking away the function but try put &docid=`1` I think that has to be there
and was the reason why Ultimateparent was better. But my memory...
I have put backticks surround the GetField snippet but it still doesn’t work.
more specific like this:
stand alone : [!GetField?&field=`id` &parent=`1` &parentlevel=`2`!] return value : 65
[[Ditto?&parents=65]] it works well
but when they were combined together, they didn’t work.
[[Ditto?&parents=[!GetField?&field=`id` &parent=`1` &parentlevel=`2`!]]]
I Think Ditto and Wayfinder didn’t recognize the number 65 which was returned from Getfield and UltimateParent snippets.
any suggestions?