I’ve written a snippet that puts the docID of the referring page into a placeholder named [+referingDocId+]. I want to use it as a parameter to the GetField snippet. But when I call GetField as follows...
[!GetField? &docid=`[+referingDocId+]` &field=`content` &parent=`0` !]
... I get no output.
Is this because: (a) placeholders can’t ever be parameters in snippet calls, (c) GetField can’t handle them, (c) I’ve got some garbage in my result (although it looks like a simple integer), (d) I’m using the wrong syntax, (d) other...?
-
MODX Staff
- 1,535 Posts
(a) is the closest answer. In most cases, snippets are processed before placeholders by the current version of the document parser.
Best bet is to use $modx->runSnippet() from within your first snippet to get the desired output from the GetField snippet.
Hope that helps,
Garry
Garry Nutting
Senior Developer
MODX, LLC
Email:
[email protected]
Twitter: @garryn
Web: modx.com