I am learning modx and stuck at a point. I want to post "uid" value to next page via POST only and want to set hidden field which will contain "uid" as a value. I believe practically its not allowed to pass values to chunk. I want to know whats the proper way so i can get POST data and use that value in chunk ??
My procedure
1) I have created resource (document) which contains call to snippet and then chunk
2) snippet contains value retrieved from POST
3) chunk contains a form and fields, I want to inject that POST value in this form.
There are several ways you could do this.
1) Return the uid value directly from the snippet (let's call it getPostData), and place the snippet call in your hidden field in the chunk like this:
Note the snippet is uncached (
[[!
opening tag) otherwise the first form submission will be cached.2) Place the snippet call in the chunk tag and have the value passed into a placeholder:
...and in your chunk set an uncached placeholder for 'uid':
3) Recommended: Use
setPlaceholders()
in your snippet to output content to placeholders anywhere in your page - you can use it to output to multiple placeholders:...and your chunk:
Documentation: http://rtfm.modx.com/display/revolution20/modX.setPlaceholders