Hi,
There’s like a bug with Wayfinder 2.0 when the call is done from a template. (I use MODx 0.9.6.2)
Wayfinder seems unable to set the startId dynamically from the current document id.
[!Wayfinder? &config=`myConfig` &startId=`[*id*]` !]
does not work when called directly from a template.
(Also not when the startId definition was stored in the config file.)
I read that startId is the only parameter of Wayfinder which is always required.
This seems both true and false for Wayfinder 2.0 :
- this is true when Wayfinder is called from within a template
- this is false when Wayfinder is called from within a document or a template variable inserted in a document, as we can simply omit to mention the startId and Wayfinder will take the id of the current document.
As the [*id*] placeholder is unable to retrieve the document id when placed in a Wayfinder call located in a template, I tried this :
[!Wayfinder? &startId=`[[GetField? &field=`id`]]`!]
This also works fine when the call is done from a document, but not when done from a template.
I wondered if these strange behaviours are due to some exectution order of the PHP scripts.
Does someone have any explanation ?
Thanks.