Assuming that you want each tab to display the same type of content, I’d add template:"AlphabeticalIndex"
(if you’re using <<tabs...>>
) or template="AlphabeticalIndex"
(if you’re using <$macrocall $name="tabs" ... />
or <$transclude $variable=tabs ... />
). Then make a separate template tiddler called AlphabeticalIndex
:
<$tiddler tiddler=<<currentTab>>>
<$list filter="[tag<currentTiddler>]">
!!! <$link/>
<$transclude mode=block />
<hr>
</$list>
</$tiddler>
Notes:
- The name of the current tab is stored in the variable
<<currentTab>>
(not <<currentTiddler>>
—this remains the name of the tiddler hosting the tab set). So we’ll start out by using the $tiddler widget to set <<currentTiddler>>
= <<currentTab>>
. (As a bonus, this $tiddler widget won’t have any effect if the <<currentTab>>
variable is undefined, so if you like, you can use this same template as a ViewTemplate on the letter tiddlers themselves, outside the tabs context.)
- The $list widget uses a filter to make a list of tiddler titles and then applies the same template—whatever you include between
<$list>...</$list>
—to each of them. Within the template, the <<currentTiddler>>
variable refers to the current list item, unless you specify another variable name to use. Here, I’ve made a very basic list template that will render
- a link to the tiddler, styled as a
<h3>
header. (Note the blank line above the header; this is needed to preserve block mode wikitext like the header!)
- the transcluded contents of that tiddler’s
text
field: <$transclude/>
defaults to tiddler=<<currentTiddler>> field=text
unless otherwise specified. {{!!text}}
would retrieve the same content, but I generally like to use <$transclude mode=block />
instead to make sure that any formatting you used in the transcluded tiddler is properly preserved.
- an
<hr>
. Self-explanatory!
I used a very simple filter, [tag<currentTiddler>]
: this means that the “A” tab will display all the tiddlers (and only the tiddlers) with the tag “A”. But it’s possible to write a filter for nearly any set of tiddlers you can think of. And in fact, since we’re displaying a template, not the contents of the “A” tiddler, “A” doesn’t even need to be an extant tiddler: <<currentTab>>
alone will give us all the information we need for this type of display.
This is a very quick and basic overview; if you have any further questions, please feel free to ask!