In my dustJS template, I make use of a combination of variable to use it as a new variable.
For example, say if I have pname and cname, then I want to create name = pname + cname.
Additionally.. I may want to create local variable based on certain condition, for example, name = {?.rep} pname {:else} pname + name {/.rep}. I may want to pass these variables into helpers.
To stick to the DRY principle, the best option would be to create local so that I can refer to this local variable later when it appears again.
I tried out with partials, something like: {<name}pname + cname{/name}, and use it later as {+name/}. But this way doesn't work with helpers, as well as the conditional block.
I think one possible solution might be that.. adding variables into the current context using helpers, but I don't know how to do.
So my question here is: how to add variable into current context, or how to define a local variable on the fly?
Thanks for your help.