Hiding tabs in side-bar

I’d like to hide tabs in the side-bar for a public-view tiddlyhost site — and only display “open”, “recent” plus a TOC tab. I don’t think I need the search field either.

I’ve opened $:/tags/SideBar and can see the existing tabs listed in the bottom section.

  • If I remove the ones I don’t need — how do I gain access to edit/add new content?
  • Are there other issues I need to be aware of?

OR can anyone suggest a plug-in/theme that hides tabs if a person doesn’t have “permissions”?

There are read only plugins and themes for public facing wikis, search a little. They also hide buttons and other elements than lead to editing.

Also you can clone the page template and make a layout with things removed, only someone in the know would use ctrl-shift-L to change to the default layout.

See Alternative page layouts

Oh thanks. Good to know this option.

LOL ---- so I’ll be doing a bit more “Y” before I can do “X” — after reading the post, ‘when the joys become pitfalls’

1 Like

Most of the UI is easily configurable.

If you mean that you see them in the list field when you’re in edit mode, then note that this only controls the order of the tabs. Any that you pull out of this list will still appear as tabs, just at the end of the list of tabs.

To remove a tab from this list, visit the tiddler, say, $:/core/ui/SideBar/Tools. (You can get a link in Advanced Search, Shadows tab, or you can make this the URL hash (e.g. https://tiddlywiki.com/#:$:/core/ui/SideBar/Tools – note the odd colon after the #, for technical reasons not worth discussing). Once you have that tiddler open, you can edit it and remove the tag $:/tags/SideBar. Now it won’t appear on the sidebar.

Note that this does not remove it from that list field in $:/tags/SideBar . If you add that tag back, this tab will reappear in the same place. I wouldn’t count on that behavior too much, because other tools may rearrange that list and lose that name. This would happen if someone were to drag the titles in the tag dropdown, for instance.

Keep a link to the tiddlers wherever you choose: in another dedicated tiddler, as a browser bookmark, with a bookmarklet that opens a number of tiddlers you choose. Or use the Advanced search to find it directly by name, or with a filter such as [all[shadows+tiddlers]prefix[$:/core/ui/SideBar/]].

You may not, but be careful about hiding it. As above, I often find it useful for myself, even in wikis intended for others…

For my own uses, I extracted and changed parts of @Mohammad’s kookma TW-Utility plugin, which allows you to toggle read-only mode with a keystroke (CTRL-SHIFT-/). I extend it with a startup script which sets read-only mode unless I’m running in Node. (My usual workflow is to develop locally using Node, deploy to a .git server, which triggers a deployment of a single-file wiki. If you’re doing something different, you might want to change that startup script to something else or remove it altogether.)

You can save this and drag it onto a (BACKED-UP) wiki to see the behavior: ReadOnly.json (4.5 KB)

If we look closely at the editor toolbar buttons they have a condition field. This is usualy made use of to change which buttons are displayed when editing tiddlers. These conditions typicaly test the tiddlers type field.

I have a work in progress, proof of concept POC to introduce the condition field to other user interface elements especialy tabs, and buttons. Basicaly the condition field is optional and if it contains a filter, that will be evaluated before displaying the tab/button etc…

  • To address the original topic here we would perhaps use a “condition” filter on each tab we want to hide, like [{$:/config/mode}!match[published]] so it will not show when $:/config/mode contains published.
  • The advantaged being the sidebar tag can remain in place

My next design question with this POC is should I also allow a “condition filter” to be also set “off tiddler” so you dont need to modify core tabs to make them conditional.

@Anakowi I made a quick solution by overriding the tabs macro core_macros_tabs.json (2.5 KB) backup your wiki or tiddler ($:/tags/SideBar), then drop this on your wiki and you should see no change at all.

Once this change is installed you can edit any tiddler that appears in a tab, such as the tiddlers that use the tag $:/tags/SideBar use <<tag $:/tags/SideBar>> to see what is currently listed.

  • In the “sidebar” tiddler add a “condition” field containing filter that produces any value, if you want it to be displayed and no value if you do not want it displayed.

For example I use this [{$:/config/design-mode}match[yes]] if the $:/config/design-mode tiddler contains yes, it will result in yes and display the tab, anything else will have no result.

  • Carful to only have one result, because you will see the same tab as many times.
    • You can use ..then[something]else[]] or the reverse ..then[]else[something]]
      or ..limit[1]]

Regards