Selecting the default tab

hi tiddlywiki-ers

I have tried the following hoping that it would set the default tab but without luck:

<<tabs "[tag[daily-challenge]]" state="$:/state/tab" default="[tag[daily-challenge]first[]]">>

Any help would be greatly appreciated,

M

Hi @moonfish

Try this:

<$transclude 
  $variable="tabs"
  tabsList="[tag[daily-challenge]]"
  state="$:/state/daily-challenge"
  default={{{ [tag[daily-challenge]first[]] }}}
/>

Notes:

  • default parameter expects a tiddler title, not a filter.
  • Your default tab filter can be computed using a “filtered transclusion”, the triple curly braces syntax I used above.
  • But a macro call can’t use the short form syntax <<mymacro XXX>> when an attribute must be dynamically computed, so I had to switch to the <$transclude> widget complete syntax.
  • Also I changed the state tiddler to ensure it doesn’t exist, otherwise the default parameter won’t be considered.

Fred

1 Like

Hi @tw-FRed many thanks, that works perfectly, M

1 Like