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
$tiddlerwidget is the most idiomatic way to set the current tiddler, but you could equivalently set the variablecurrentTiddlerusing something like a$letwidget. - We didn't specify a tiddler for the
$transcludewidget. That's because if you don't specify either a$tiddleror$variableparameter, the widget defaults to transcluding the current tiddler. - We specified
mode="block"on the$transcludewidget. We could also have left blank lines around the$transcludewidget 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.