Trigger the display of particular sidebar tabs via page control buttons

Hi. I’m interested in the default sidebar tab being shown when the “Home” and “Close All” page control buttons are triggered.

I have been looking at these two tiddlers and imagine an answer lies in modifying them, or perhaps the macro that draws them:

$:/core/ui/PageTemplate/pagecontrols
$:/core/macros/tabs

This is my wiki: Jennifer's Notebook — Hypertext, realized

Any tips or directions are most welcome. :slight_smile:

1 Like

Some quick info

  • The $:/tags/SideBarSegment tag <<tag $:/tags/SideBarSegment>> is how Items are added to the sideBar
  • The Tiddler $:/core/ui/SideBarSegments/tabs is one of these and
    • lists the sidebar tabs with <<tag $:/tags/SideBar>>
    • Review $:/core/ui/SideBarSegments/tabs for the code

$:/core/ui/SideBarSegments/tabs
To cut a long story short each time you select a tab it updates explicitState="$:/state/tab/sidebar--595412856"/> with the tabs tiddlername. Eg open the Open tab and it contains $:/core/ui/SideBar/Open

Now modify the Home and Close all Buttons, perhaps using actions=<<your-actions>> on the button widget and ;

To force the open tab

\define your-actions()
<$action-setfield $tiddler="$:/state/tab/sidebar--595412856" text="$:/core/ui/SideBar/Open"/>
\end

Or replace the above text with a link to where the default tab is stored, which I could not find at time of writing;

\define your-actions()
<$action-setfield $tiddler="$:/state/tab/sidebar--595412856" text={{default tab tiddler}}/>
\end

Thank you, this is very helpful. I shall puzzle on it.

1 Like

On tiddlywiki.com search for SystemTag for a lot more :nerd_face:

1 Like

What is the reasoning behind the name of these state tiddlers having a long string of numbers?

It is so each tiddler can generate its own unique state tiddler because this number is influenced by where the <<qualify prefix>> macro was invoked. It is however somewhat redundant when used in core tiddlers like the page template because the “number” will always be the same.

  • If you wanted to toggle something on each tiddler seperatly you need a different state tiddler for every tiddler or they would affect other tiddlers.