1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-26 19:47:20 +00:00

Docs: Make currentTab variable tiddler, link from it to tabs Macro (#8310)

This commit is contained in:
springerspandrel 2024-06-29 08:24:26 -04:00 committed by GitHub
parent 2f2806c00c
commit 1937789ee2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 2 deletions

View File

@ -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>>.

View File

@ -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=<<currentTab>>>