Modx Ditto display count

260 Views Asked by At

Can i use a variable inside Ditto placeholder? For example

[!Ditto? &tpl=`TPL-jc` &display=$myVar]

instead of

[!Ditto? &tpl=`TPL-jc` &display=`10`]
1

There are 1 best solutions below

0
On BEST ANSWER

You can use another Element inside a Ditto placeholder, e.g.

[!Ditto? &tpl=`TPL-jc` &display=`[+myVar+]`]

(that's myVar as a placeholder)

[!Ditto? &tpl=`TPL-jc` &display=`[myVar]`]

(that's myVar as a Snippet that outputs the value you want)

[!Ditto? &tpl=`TPL-jc` &display=`[*myVar*]`]

(that's myVar as a Template Variable)