Folks,
Another long standing question of mine, I have finally found out how to ask.
When you use set or vars widgets they need to be closed or closure is assumed at the end of the tiddler in some circumstances. This means the need to wrap around the area where they are valid.
The advantage of the vars widget is you can have one or more variables set and close the widget once (always) rather than the set widget(s) which requires multiple closing </$set>
statements.
For example;
<$vars
variable1={{!!field1))
variable2={{tiddlername}}
>
Some wikitext that uses the variables
</$vars>
- My Question is; Is there any way to replace the following part of the vars widget;
variable1={{!!field1))
variable2={{tiddlername}}
with a “transclusion or variable” that can name the variable(s) and there values?, such that I can change the number of variables defined by changing the contents of the “transclusion or variable”?
The reason I ask is: This would be a way to introduce some hackability to “programaticaly introduce new variables” without editing the tiddler that contains the var widget, and allow
Some wikitext that uses the variables
to respond to changes in those variables?
I hope others can learn from my resolution of this issue.
- I must also say as far as I can see the answer is no, but it seems to me a missing feature in how we can code wikitext, macros and variables. I have seen and identified a number of cases where I come up hard against this “apparent” limitation.
- Thus if no what can we do about it?
Once again, thanks in advance.