First, create a template tiddler called ContactTabTemplate
with content like the following:
<$tiddler tiddler=<<currentTab>>>
<$transclude mode="block"/>
</$tiddler>
When each tab is transcluded through this template, the current tiddler will be set to <<currentTab>>
prior to rendering each tab's tiddler, so all references to the current tiddler within that tab's tiddler will now be set in the same way as if that tiddler were being rendered directly in the story river.
A couple of notes:
- The
$tiddler
widget is the most idiomatic way to set the current tiddler, but you could equivalently set the variablecurrentTiddler
using something like a$let
widget. - We didn't specify a tiddler for the
$transclude
widget. That's because if you don't specify either a$tiddler
or$variable
parameter, the widget defaults to transcluding the current tiddler. - We specified
mode="block"
on the$transclude
widget. We could also have left blank lines around the$transclude
widget to get the same effect. We'll talk more about this next chapter, in Block Mode and Inline Mode.
Once the template tiddler is in place, add a template:ContactTabTemplate
parameter to the tabs
call used to render your contact tabs to use this template.