Tabs macro default parameter not working

I can not get the default parameter in the tabs macro to work because the state tiddler is set to a value. How can I set the state tiddler to the value I want?

Is there a reason there is no simple statement like ‘set tiddler X field Y value Z’

<<tabs "[tag<currentTiddler>]" default:"RAAHC3_Why" template:"$:/TLS/ViewTemplateGun" >>

bobj

Normaly the default tab is the the one set in default, however as soon as you change tabs the state tiddler is updated and you will never return to the default, unless you delete or change the content of the stAte tiddler.

  • However there is an explicitState parmater that allows you to define the title of your own state tiddler, and thus you can get the tabs macro to use a title for the state tiddler you know and can set, reset or delete if desired.

Note: Answered from memory and not tested

1 Like

Something about this reminds me of one of my favorite quotes from Donald Knuth:

Beware of bugs in the above code; I have only proved it correct, not tried it.

To add to Tony’s suggestion, if you use a tiddler with the prefix $:/temp/ rather than $:/state/ as your explicitState, it won’t be saved with the rest of your wiki, so the tabs will return to their default state each time you load the wiki.

If you don’t want to invent your own $:/temp tiddler title, I recommend using the $macrocall format, which will allow you to use the <<qualify>> macro to generate a title. Your code might thus look something like this:

<$macrocall $name=tabs
	tabsList="[tag<currentTiddler>]"
	default="RAAHC3_Why"
	template="$:/TLS/ViewTemplateGun"
	explicitState=<<qualify "$:/temp/tab">>
/>
1 Like