Is there a way to pass a parameter to a chunk?
I’d like to do some thing like this
{{MyChunk? ¶m=`myParameter`}}
and be able to usesomething like [+param+] inside the chunk
I guess the snippet is better for something like this, but I figured for something this simple there might be a way to do that rather then writing an extra snippet
So this feature is not supported in 0.9.6?
How do I pass parameters to a chunk then?
I noticed that one of the chunks {{mh.RowTpl}} has is using variables that are not defined
<li class="category [+wf.classnames+]"><a href="[+wf.link+]" title="[+wf.title+]">[+wf.linktext+]</a>[+wf.wrapper+]</li>
is it possible to send a placeholder to the chunk from a non-snippet?
In Evo, there is no way you can do that AFAIK.
ok, well if anyone else needs to do this, this is what I’ve done
[[PassParameter]]
pass a parameter(&pName)(&pVal) to a chunk(&tpl)
<?php
// Set parameter to parse
$params[$pName]=$pVal;
// Carry out chunk &tpl
$documentOutput.=$modx->parseChunk($tpl, $params, ’[+’, ’+]’);
// Output
echo($documentOutput);
?>
usage
[[PassParameter? &pName=`itemID` &pVal=`1` &tpl=`myTemplate`]]