Question

Can i use a variable inside Ditto placeholder? For example

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

instead of

[!Ditto? &tpl=`TPL-jc` &display=`10`]
Was it helpful?

Solution

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)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top