Default Sidebar Tab

554 views
Skip to first unread message

Damon Pritchett

unread,
Oct 8, 2019, 12:35:27 AM10/8/19
to TiddlyWiki
Hello once again,

I would like to have my TW open with my Contents tab in the Sidebar always selected regardless of what the state of the Sidebar the last time I saved. Is there a way to do this? This may be simple, but I haven't found a solution yet.

Thanks,

Damon

Birthe C

unread,
Oct 8, 2019, 2:26:59 AM10/8/19
to TiddlyWiki
Create a tiddler with tag  $:/tags/StartupActions

And the content:
<$action-setfield $tiddler="$:/state/tab/sidebar--1835078512" $value="Contents"/>


Birthe

Mat

unread,
Oct 8, 2019, 6:36:50 AM10/8/19
to TiddlyWiki
I think this should work:

Change the default parameter in

$:/core/ui/SideBarSegments/tabs

to be

default="TableOfContents"   (this is the title of the Contents tiddler used on tiddlywiki.com - mabye you have another name for the Contents tiddler)

<:-)

Mohammad

unread,
Oct 8, 2019, 10:41:14 AM10/8/19
to TiddlyWiki
This seems not work!
A state tiddler is used here $:/state/tab/sidebar-- ??

By the way 


is used to set the default value if the state tiddler is not existed

--Mohammad

Birthe C

unread,
Oct 8, 2019, 10:46:31 AM10/8/19
to TiddlyWiki
The state tiddler will exist, because you will have one of the tabs open. You will ned to go to advanced search and find the exact number to write. It was not the same in any of my wikis ;-).


Birthe

Damon Pritchett

unread,
Oct 8, 2019, 1:20:16 PM10/8/19
to TiddlyWiki
Interestingly, my wiki has two state tiddlers with numbers. One number is the same as yours and the other is different. The one with the same number doesn't work, but the one with the different number does. Not sure what the difference is. Do these number change over time and will I have to periodically update my startup tiddler with a new number?

Many thanks,

Damon

Birthe C

unread,
Oct 8, 2019, 2:03:01 PM10/8/19
to TiddlyWiki
Hi Damon,

I found that out also after I had written here. I think it is from editing the Contents - or something. The one I have had to use in the my other wikies I tried it on is: $:/state/tab/sidebar--595412856.

You can try opening the statetiddler and see what happens when you click your tabs. Only the "good" number will work with all of them. (at least it seemed so to me). But for it to work we really must have only one number.


Birthe

TonyM

unread,
Oct 8, 2019, 7:36:06 PM10/8/19
to TiddlyWiki
Damon,

I should have posted earlier.

Has every one forgotten Control Panel > Settings

Default More Sidebar Tab

Specify which More sidebar tab is displayed by default

Default Sidebar Tab

Specify which sidebar tab is displayed by default



Regards
Tony

Damon Pritchett

unread,
Oct 8, 2019, 7:56:40 PM10/8/19
to TiddlyWiki
Hey Tony,

Thanks, but I haven't really noticed that does what I want. What I've been experiencing, even with my Contents tab selected as default, is that whatever sidebar tab I had selected when I saved was what was selected when the TW was reopened. Doing as Birth suggested with $:/state/tab/sidebar--595412856, indeed accomplished what I was looking for which was that the Contents tab was always selected when I reopen a TW regardless of what tab was selected when I last saved.

Damon

TonyM

unread,
Oct 8, 2019, 8:33:57 PM10/8/19
to TiddlyWiki
Damon,

Yes, I see. Tiddlywiki is trying to be helpful and save the last state making the default almost useless. Other ways is to 
  • Exclude that tiddler from the save filter see $:/core/save/all and https://tiddlywiki.com/#SavingMechanism
    • Set a global variable for publishFilter eg: -[[$:/state/tab/sidebar--595412856]]
  • When I release my custom actions on buttons tool (or its in the core) you could delete this tiddler before saving.
  • and possibly more
Regards
Tony

Birthe C

unread,
Oct 8, 2019, 8:41:52 PM10/8/19
to TiddlyWiki
The default setting does explain why we had more state numbers...setting the default first before choosing and saving anything else gives us the

$:/state/tab/sidebar--1835078512.


Birthe

Damon Pritchett

unread,
Oct 8, 2019, 9:08:07 PM10/8/19
to TiddlyWiki
Once again, thanks to all. Most helpful.

Damon

Hubert

unread,
Oct 15, 2019, 11:21:58 AM10/15/19
to TiddlyWiki
The default setting does explain why we had more state numbers...setting the default first before choosing and saving anything else gives us the

$:/state/tab/sidebar--1835078512.


Does anyone know what that number means, whether it's random and whether it could be customised for consistency?

Apologies if that was already explained above; I couldn't conclude whether an agreement on what this means has already been reached.

Regards,
Hubert

TonyM

unread,
Oct 15, 2019, 7:45:59 PM10/15/19
to TiddlyWiki
Hubert,

Such tiddlers are typically generated using the qualify widget. It makes use of the currentTiddler to generate a hashed number with an optional prefix. Using Qualify in the same tiddler with the same title will always return the same number so it is great for temporary or  switch type tiddlers relating to a specific tiddler.

Here is an example of my "hunt and peck" strategy to learn what is going on.

To generate 

$:/state/tab/sidebar--1835078512 we would expect somewhere the code

<<qualify $:/state/tab/sidebar>>

  • If you look at items tagged $:/tags/PageTemplate you discover 
  • $:/core/ui/PageTemplate/sidebar 

    If you look inside you see $:/tags/SideBarSegment is used to display the side bar
  • If you look at items tagged $:/tags/SideBarSegment  you see  $:/core/ui/SideBarSegments/tabs
  • if you look inside $:/core/ui/SideBarSegments/tabs you see it uses the tabs macro and the state= parameter

state="$:/state/tab/sidebar"



  • This is the prefix of $:/state/tab/sidebar--1835078512.
  • I happen to know most core macros can be found in the shadow tiddlers.

Then looking at $:/core/macros/tabs we see it is in fact using Qualify 
<<qualify "$state$">>

So this depends on the currentTiddler in which it is defined.

Note: Unless inside a list that causes a change in currentTiddler, tabs in the sidebar do not have a currentTiddler value but there is a currentTab variable.

Regards
Tony

Hubert

unread,
Oct 16, 2019, 12:55:18 PM10/16/19
to TiddlyWiki
Thank you for your exhaustive explanation Tony. I admit, this will take some time to ingest.

Regards,
Hubert

Damon Pritchett

unread,
Mar 29, 2020, 6:03:16 PM3/29/20
to TiddlyWiki
Hey all,

So I installed the menu bar and moved my contents to that instead of having it in the sidebar. Now I want my default sidebar tab to be Railroads, but what worked with the state tiddlers before does not work now. Now there is no sidebar tab selected at all on startup and I haven't been able to do anything to change that. Any ideas?

Thanks,

Damon

TonyM

unread,
Mar 29, 2020, 7:36:49 PM3/29/20
to TiddlyWiki
Daemon

The default side bar tab is set in control panel settings or directly
$:/core/ui/ControlPanel/Settings/DefaultSidebarTab

Is that what you need?

Tony

Damon Pritchett

unread,
Mar 29, 2020, 7:41:54 PM3/29/20
to TiddlyWiki
No, that is not working.

Damon

Damon Pritchett

unread,
Mar 30, 2020, 7:07:51 PM3/30/20
to TiddlyWiki
So I'm still not having any luck getting the default tab to get set the way I want. The tab I'm trying to use as also has a set of horizontal tabs in it. I have the default of that set of horizontal tabs default set when I set them up. Could this have something to do with it? The state tiddlers which I modified previously (see other post in this topic) did not work.

Damon

TonyM

unread,
Mar 30, 2020, 7:39:34 PM3/30/20
to TiddlyWiki
Daemon

Some possible leads for you.

One thing about the sidebar is current tiddler is not set. Qualify makes use of currenttiddler. You can set current Tiddler inside your sidebar tiddler with the tiddler widget.

Inside tabs the currentTab variable replaces current tiddler with the tabtiddlers title

Also when setting the default use the tiddler name not the caption name.

Best of luck
Tony

Damon Pritchett

unread,
Mar 30, 2020, 8:25:03 PM3/30/20
to TiddlyWiki
Tony,

The particular tiddler I want to use as the default sidebar does not have a caption. It's just a single word title.

As far as your other comments go, I'm afraid that I did not understand where you were leading me. I guess it's the lack of detailed TW knowledge.

Damon

TonyM

unread,
Mar 30, 2020, 11:31:16 PM3/30/20
to TiddlyWiki
Damon,

I understand. Working through every detail can be time consuming. 
  • I suggest you make a minimal example of your problem, Test it on Tiddlywiki.com or a new empty tiddler and share that code here so I/we can replicate and solve the problem. 
So often when someone prepares an example case like this, they solve the problem themself, anyway, if not, we can definitely help with less time/effort on our part as well.

Regards
Tony

Jeremy Ruston

unread,
Mar 31, 2020, 7:05:12 AM3/31/20
to TiddlyWiki
Birthe’s solution was along the right lines. Try creating a tiddler tagged $:/tags/StartupActions containing:

<$action-setfield $tiddler="$:/state/tab/sidebar--595412856" $value=“Contents"/>

Substitute for “Contents” the title of the tiddler containing the sidebar tab you want to use.

Best wishes

Jeremy.

-- 
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/9f410a18-6aa8-45a5-94fc-165f0319dd6a%40googlegroups.com.

Damon Pritchett

unread,
Mar 31, 2020, 1:27:56 PM3/31/20
to TiddlyWiki
Hi Jeremy,

Thanks for responding. I did as you suggested and it made no difference. The default tab for the sidebar is stuck at Contents no matter what I've tried. 

When this thread started last fall, Birthe's solution worked for me. That may be because I was actually wanting it to default to Contents at the time.  There must be something in my TW that is causing this. I'm going to try to strip down my TW to the bare bones to see if something makes a difference. I suppose, in the meantime, I can put the material that I want into the Contents tab and move on, but I'd like to know what is going on. I guess it's the engineer in me.

Damon


On Tuesday, March 31, 2020 at 4:05:12 AM UTC-7, Jeremy Ruston wrote:
Birthe’s solution was along the right lines. Try creating a tiddler tagged $:/tags/StartupActions containing:

<$action-setfield $tiddler="$:/state/tab/sidebar--595412856" $value=“Contents"/>

Substitute for “Contents” the title of the tiddler containing the sidebar tab you want to use.

Best wishes

Jeremy.

On 31 Mar 2020, at 04:31, TonyM <anthon...@gmail.com> wrote:

Damon,

I understand. Working through every detail can be time consuming. 
  • I suggest you make a minimal example of your problem, Test it on Tiddlywiki.com or a new empty tiddler and share that code here so I/we can replicate and solve the problem. 
So often when someone prepares an example case like this, they solve the problem themself, anyway, if not, we can definitely help with less time/effort on our part as well.

Regards
Tony



On Tuesday, March 31, 2020 at 11:25:03 AM UTC+11, Damon Pritchett wrote:
Tony,

The particular tiddler I want to use as the default sidebar does not have a caption. It's just a single word title.

As far as your other comments go, I'm afraid that I did not understand where you were leading me. I guess it's the lack of detailed TW knowledge.

Damon


On Monday, March 30, 2020 at 4:39:34 PM UTC-7, TonyM wrote:
Daemon

Some possible leads for you.

One thing about the sidebar is current tiddler is not set. Qualify makes use of currenttiddler. You can set current Tiddler inside your sidebar tiddler with the tiddler widget. 

Inside tabs the currentTab variable replaces current tiddler with the tabtiddlers title

Also when setting the default use the tiddler name not the caption name.

Best of luck
Tony






-- 
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddl...@googlegroups.com.

Birthe C

unread,
Mar 31, 2020, 2:08:08 PM3/31/20
to TiddlyWiki
Hi Damon,

Go to advanced search and search for $:/state/tab/sidebar
You might have more than one. Then look at the content. I think you should be able to figure it out. I do remember I got rather confused with some of my own TWs when we discussed it last fall.

Birthe

Damon Pritchett

unread,
Mar 31, 2020, 2:20:52 PM3/31/20
to TiddlyWiki
Did that and edited all of them to add the tab I wanted as default just like we did last fall. That did not change the behavior at all. Still come up to Contents if it exists or no tab selected if it doesn't.

Damon

Damon Pritchett

unread,
Apr 1, 2020, 5:05:58 PM4/1/20
to TiddlyWiki
After playing around this afternoon disabling and/or uninstalling plugins and checking stylesheets, I cannot for the life of me understand why my default sidebar tab is stuck at Contents. I downloaded a new, empty TW and started to modify it to see what made the default stick, but I didn't get very far with other things going on. The brand new TW behaves as expected, so something I did along the line broke the default sidebar tab. At this point, I'm probably going to go with my work-around by adding what I want in the default tab to the Contents tiddler and adding a caption to name it what I want. It's making my brain hurt.

Damon

TonyM

unread,
Apr 1, 2020, 10:08:54 PM4/1/20
to TiddlyWiki
Damon,

This is not very common in TiddlyWiki but Can happen. If you get an empty file and import your existing wiki it should block core tiddlers and the others are your tiddlers, you could then use the preview on suspicious tiddlers.

Alternatively in your wiki advanced search look for all shadow tiddlers that have being modified and look inside them to see if the edits could be the causer.

Another method is to research the whole side bar mechanism on an empty.html and check your own wiki for any variance. 

There are many ways to do this that you learn over time. Alternatively you could make the wiki (or a reduced content version with the same problem) available to all or a trusted community member and let them have a look for you.

There is also the procrastinators approach, let go of that issue for now and continue with other items. Procrastinators sometimes suddenly discover what the did wrong when the stop thinking about it. Thus justifying their procrastination.

best of luck
 Tony

Mark Kerrigan

unread,
Apr 1, 2020, 11:17:00 PM4/1/20
to TiddlyWiki
Hello Damon

Don't despair, I struggled with this for quite some time. There's ultimately 3 things I did to make my default sidebar tab "TabMain"

Change

$:/config/DefaultSidebarTab


contains TabMain

Change

$:/core/ui/SideBarSegments/tabs


to the following. I made a few more modifications from what the default shadow contents are, but you'll notice TabMain is in first item in the tabsList.

<div class="tc-sidebar-lists">

<$macrocall $name="tabs" tabsList="TabMain $:/core/ui/SideBar/Open $:/core/ui/SideBar/More" default={{$:/config/DefaultSidebarTab}} state="$:/state/tab/sidebar" />

</div>

Also create a tiddler called Startup, tag it with $:/tags/StartupAction and add the following

<$action-setfield $tiddler="$:/state/tab/sidebar--595412856" $value="TabMain"/>

If you do all three of these things then you should be able to create your arbitrary tiddler to use as the default sidebar tab.

I created a blank empty TW5 with all of these modifications made if you would like to see it in action.

Thanks
Mark Kerrigan


default-tab.html

Damon Pritchett

unread,
Apr 2, 2020, 2:50:40 PM4/2/20
to TiddlyWiki
Hey Mark & Tony,

Thanks for the replies.

Tony, I tried the empty tiddler approach and, at first blush, nothing really popped out at me. I think researching the whole sidebar approach is an interesting idea and will certainly be a learning experience. 

Mark, I had previously tried the StartupAction tiddler and it had no effect. I did try all three of your suggestions and that changed the behavior such that it now opens with the tab that was last saved. It definitely seems as if the startup action is not occurring. That state tiddler in the startup actions tiddler always has the currently selected tab in it.

I think for now, I'm going to follow Tony's advice and let it sit for a while and come back to it later.

Thanks,

Damon

TonyM

unread,
Apr 2, 2020, 6:00:39 PM4/2/20
to TiddlyWiki
Damon,
 
Tony, I tried the empty tiddler approach and, at first blush, nothing really popped out at me. I think researching the whole sidebar approach is an interesting idea and will certainly be a learning experience. 

I another thread, a reply of mine was a wikitext dump of my research notes. Basically containing a list of relevant tiddlers and high level notes. You can think of them as field notes of a researcher.

I thought that what if we/I undertake short focused research building a set of research notes for publishing. It would be an informal way to document more complex mechanisms and give the reader the benefit of a more experienced user. Then further replies and feed back could be incorporated into the research  notes.

This is useful for myself but see it could help others research specific mechanisms. 

Of late I have discovered really interesting methods and possibilities but it will take a lot longer to translate these into either solutions/plugins short sharp and focused research notes may fill the gap. I will try and do one for the sidebar
 from a designer (not coder) perspective examples would include;
  • The Import mechanism
  • The Side Bar Mechanism
  • The Open in new window mechanism
  • The Export mechanism
  • etc...
What do you think?

Regards
Tony

Damon Pritchett

unread,
Apr 4, 2020, 4:36:36 PM4/4/20
to TiddlyWiki
Tony,

That's an excellent approach. When I decide to tackle this problem again, I will try to follow this while I'm looking into it.

Damon

A Gloom

unread,
Apr 7, 2020, 6:44:49 AM4/7/20
to TiddlyWiki
If I'm understanding correctly, you want a way to set the sidebar tab in the new (topbar) menu plugin with 5.1.22?

the sidebar tab for the topbar menu sidebar is set by a separate state tiddler than the normal sidebar-- experiment by clicking each sidebar"instance" and you'll see they don't effect each other, they can be set to different tabs.  The state tiddler I found that changes by clicking the sidebar in the topbar menu was $:/state/tab/sidebar-1477732604

use this list widget to see the newest state tiddler and see which changes when clicking the topbar menu sidebar, then use that state tiddler in the startup tiddler Birthe suggested

<$list filter="[all{shadows}prefix[$:/state]days[-1]]">

{{!!title}} -- {{!!text}}
</$list>

Damon Pritchett

unread,
Apr 15, 2020, 9:08:07 PM4/15/20
to TiddlyWiki
All,

Just for grins today, I decided to use the methods previously discussed to set the default sidebar tab in an empty 5.1.22 TW. Alas, I was unable to get the sidebar tab to start up with anything other than the last saved tab. The tiddler tagged with $:/tags/StartupAction seemed to have no effect. This is slightly different than the behavior in my own TW. Oh well, time to let the brain rest and put this in the background for another week or two.

Damon

Damon Pritchett

unread,
May 1, 2020, 1:36:19 PM5/1/20
to TiddlyWiki
Hello all,

Just wanted to let you know that I've solved the default sidebar tab problem i was having. I had a startup action that I had forgotten about that was overriding my wishes. Once I fixed that, everything was fine.

Damon
Reply all
Reply to author
Forward
0 new messages