Modx Ditto display count

253 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 answers

0
Mike Schell 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)