tabs macro issue with transclusion, why not use a default template

80 views
Skip to first unread message

Mohammad

unread,
Feb 6, 2020, 5:34:34 AM2/6/20
to TiddlyWiki
Looking at: https://tiddlywiki.com/prerelease/#tabs%20Macro

It says

The currentTiddler variable is not affected by the tabs macro. This can put you in trouble if the list of tabs includes tiddlers that depend on the value of the currentTiddler, for example tiddlers listing children based on its own name. To overcome this problem you can use a TemplateTiddler like the following:

<$tiddler tiddler=<<currentTab>>>
<$transclude mode="block" />
</$tiddler>


Why not have a tiddler template like $:/tabs/template with the value

<$tiddler tiddler=<<currentTab>>>
<$transclude mode="block" />
</$tiddler>


and set the dfault value of template parameter in tabs macro to $:/tabs/template to address this issue automatically?

--Mohammad

TonyM

unread,
Feb 6, 2020, 5:55:39 AM2/6/20
to TiddlyWiki
If I recall the tabs macro uses a default template anyway. But if you want to act on the containing tiddler or the currentTab just converting current tab to current tiddler is your choice.

Typically the tab is just the content of the tab tiddler but it could contain buttons to operate on any tiddler including the story tiddler.

By the way you can use <<storyTiddler>> for the displaying tiddler.

I hope this helps.

Regards
Tony

Mohammad

unread,
Feb 6, 2020, 6:20:35 AM2/6/20
to TiddlyWiki
Is storyTiddler a variable here?

TonyM

unread,
Feb 7, 2020, 4:08:24 AM2/7/20
to TiddlyWiki
Mohammad

The storyTiddler variable is set when displaying each tiddler in The story and is not reused as often as currentTiddler so it should be available in any viewed tiddler or the tiddlers or macros within them.

Regards
Tony

Mohammad

unread,
Feb 7, 2020, 4:52:34 AM2/7/20
to TiddlyWiki
Thanks Tony!
Reply all
Reply to author
Forward
0 new messages