Answer the question
In order to leave comments, you need to log in
[[+content_image]]
How to pass your parameter to a chunk that acts as a template?
There is a snippet that generates the site menu:
[[pdoMenu ?
&parents=`0`
&level=`1`
&tplOuter=`page_main_menu_other_tpl`
&tpl=`page_main_menu_row_tpl`
&tplHere=`page_main_menu_row_tpl`
&outerClass=`main-menu`
&firstClass=``
&hereClass=`current`
&lastClass=``
&countChildren=`1`
]]
[[$page_main_menu_other_tpl ? my_param=`12345`]]
<div>[[+my_param]]</div>
Answer the question
In order to leave comments, you need to log in
What value are you passing?
Not a direct answer, but still - in a chunk, you can directly access the fields of the selected resources, or by ID to the fields of any other resources.
The following may also help you: pdoMenu inherits pdoTools https://docs.modx.pro/komponentyi/pdotools/snippet... common options , among which are
&tplCondition - The resource field from which the value will be obtained for selecting a chunk by condition in &conditionalTpls .
&tplOperator - An optional operator to compare the resource field in &tplCondition with an array of values and chunks in &conditionalTpls.
&conditionalTpls - a JSON string with an array whose keys indicate what &tplCondition will be compared against , and the values - chunks that will be used for output if the comparison is successful. The comparison operator is specified in &tplOperator . For operators of type isempty, you can use an array without keys.
&tplCondition=`id`
&tplOperator=`==`
&conditionalTpls=`{"1":"имя чанка 1", "2":"имя чанка 2"}`
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question