Folks,
[Edit] I have Renamed this thread as its a valuable resource and will split out the discussion on futures
I am deep in other research and want to clarify if my understanding of the following is true; If correct it may help document this for those finding the shorthand transclusions insufficient.
I have long felt there is a slight gap in my understanding of the transition from shorthand transclusions to the widget form.
Imagine the currentTiddler variable is set, then we have;
<$transclude/>
My understanding is the above will transclude the currentTiddler - but effectively just its text field. This is then rendered.
- Is this equivalent to
{{currentTiddler}}
?
Again if the currentTiddler is set and we have;
<$transclude tiddler=othertiddler />
My understanding is the above will transclude the currentTiddler - but it will do this using the “template” othertiddler. Thus equivalent to {{||othertiddler}}
with currentTiddler assumed.
Then in the following case;
<$tiddler tiddler=subjectTiddler>
<$transclude tiddler=othertiddler />
</$tiddler>
I understand this to be the equivalent of {{subjectTiddler||othertiddler}}
We may also note;
The TranscludeWidget treats any contained content as a fallback if the target of the transclusion is not defined (ie a missing tiddler or a missing field).
Thus if we had the following;
<$tiddler tiddler=subjectTiddler>
<$transclude tiddler=othertiddler>
yetanothertiddler
</$transclude>
</$tiddler>
Then I understand if “othertiddler” did not exist “yetanothertiddler” would be used as the template.
That is the equivalent of {{subjectTiddler||yetanothertiddler}}
is and only if “othertiddler” does not exist and/or has an empty text field.
Questions;
- Are my observations correct?
- If so then, is a little misleading that its tiddler=othertiddler rather than template=othertiddler?
- Given the above, what will happen in the following case;
<$transclude tiddler=othertiddler field=fieldname/>
?
3.1 and / or it does not contain anything in the fieldname?
3.2 what is the short hand versions of this
Thanks in advance! (1am here - good night)