diff --git a/editions/tw5.com/tiddlers/currentTab Variable.tid b/editions/tw5.com/tiddlers/currentTab Variable.tid new file mode 100644 index 000000000..288f4b8a3 --- /dev/null +++ b/editions/tw5.com/tiddlers/currentTab Variable.tid @@ -0,0 +1,12 @@ +caption: currentTab +created: 20240627195924480 +modified: 20240627201655746 +tags: Variables [[Core Variables]] +title: currentTab Variable +type: text/vnd.tiddlywiki + +The <<.def currentTab>> [[variable|Variables]] contains the title of the current tab within an enclosing set of tabs generated by the [[tabs Macro]]. + +When a tiddler is [[transcluded|Transclusion]] within a tab, any use of the [[currentTiddler Variable]] will point to the tiddler containing the [[tabs Macro]] call. This may lead to surprises if the transcluded tiddler was originally written to display by itself in the [[Story River]] in ways that rely on self-reference. The currentTab macro enables a similar effect to currentTiddler for the special case of a tiddler rendered as a tab. + +Compare <<.vlink currentTiddler>>. \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/macros/TabsMacro.tid b/editions/tw5.com/tiddlers/macros/TabsMacro.tid index 4708e6356..38e6bbe51 100644 --- a/editions/tw5.com/tiddlers/macros/TabsMacro.tid +++ b/editions/tw5.com/tiddlers/macros/TabsMacro.tid @@ -1,6 +1,6 @@ caption: tabs created: 20131228162203521 -modified: 20210721122823354 +modified: 20240627201724476 tags: Macros [[Core Macros]] title: tabs Macro type: text/vnd.tiddlywiki @@ -34,7 +34,7 @@ By default the tabs are arranged horizontally above the content. To get vertical Within the template, the title of the selected tab is available in the <<.var currentTab>> variable. -The <<.vlink currentTiddler>> variable is not affected by the <<.var tabs>> macro. This can put you in trouble if the list of tabs includes tiddlers that depend on the value of the <<.vlink currentTiddler>>, for example tiddlers listing children based on its own name. To overcome this problem you can use a [[TemplateTiddler|TemplateTiddlers]] like the following: +The <<.vlink currentTiddler>> variable is not affected by the <<.var tabs>> macro. This can put you in trouble if the list of tabs includes tiddlers that depend on the value of the <<.vlink currentTiddler>>, for example tiddlers listing children based on its own name. To overcome this problem you can make use of the <<.vlink currentTab>> variable, which can be used in a [[TemplateTiddler|TemplateTiddlers]] such as the following: ``` <$tiddler tiddler=<>>