I've read in the doc that widgets are the fundamental part of tiddlywiki and that all wiki syntax sugar is finally resolved as a number of widgets.Use of template is only described with transclusion as {{||template}} (with tiddler or field or index before ||).the transclude widget has no template attribute.How then is done the transclusion? Shouldn't the transclude widget have a template attribute?
Also, I've come across $:/tags/ViewTemplate which is only described as: "The system tag $:/tags/ViewTemplate marks the view template." which is not very telling.
I've done tenplates tgat work fine. They are not tagged $:/tags/ViewTemplate. If I tag them as scuch, they act aout as if their content was twice included. What does $:/tags/ViewTemplate really do? How should it be used?
Here are some things that change the current tiddler:
Here are some things that change the current tiddler:
- Transcluding another tiddler with the {{curly braces}} syntax.
- Using a $list widget to enumerate the outputs of a filter.
- Directly setting currentTiddler with a $set or $vars widget.
Does it mean that you can change the content of a var or that you stack up vars, getting only the values from the top var?
Could it be used to have some kind of recursion in a safe way?
I was thinking of vars as immutable stuff because of the syntax that declare them but no syntax to alter them otherwise.
And finnally, in a number of my templates, the template content is only <<myMacro>>. It seems a bit out of touch with what your telling me with what template are. In effect, myMacro is only used there. Would it b a better idea to ditch the macro and have the macro body directly into the template text? (yes, myMacro has no params.)
Thank you to both of you for your explanation. The information on the system tag was very helpful.@Soren: you write tgis in your textbook:
[...]