According to the documentation at muddydogpaws [[Wayfinder? &startID=`[*id*]`]] should work, right?
For some reason the [*id*] does not resolve within the wayfinder call. I put it in the content beneath the wayfinder call and it comes back as the document ID as I would expect, but when using within the wayfinder I get no output. If I hard code in the document id then it works as expected.
Anyone else get [*id*] or [*parent*] for that matter to work within wayfinder call?
-
☆ A M B ☆
- 24,524 Posts
That’s &startId and not &startID.
&startID is (or was) a Ditto parameter. I still get these confused.
Bob
-
MODX Staff
- 12,272 Posts
Those should be unified IMO and put into a best practices page for add-on development in the wiki.
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
Thanks for the responses. I mistyped the subject for this.
I actually do have it correct. &startId=`[*id*]`
Still, it doesn’t work. Like I said, when I hard code the number in it works. IE: &startId=`52`
And I put [*id*] in the content for the page and it does display 52 on the page. Just doesn’t work when I plug that into the wayfinder call.
Is it not supposed to work that way?
-
☆ A M B ☆
- 24,524 Posts
Try the Wayfinder call uncached ... [!Wayfinder? ... !]
-
☆ A M B ☆
- 24,524 Posts
Not 100% sure, would need to check the code in document.parser.whatever.php, but I believe that snippets are parsed before template variables are, so the snippet is being parsed without the value of the TV; it’s trying to use the TV tags for the parameter value.
When a snippet is called [!...!], the parser doesn’t process the snippet; it replaces the [! and !] with the usual [[ and ]], finishes parsing the document, then runs the whole document through the parser again. But this time, the TV has been parsed (it was parsed eventually in the initial pass), so now you’ve got the TV value in place for the snippet’s parameter.