Looking for a simple possibility to switch the sidebar from right to left and back?

Hello Experts,

After reading 3 hours of topics with sidebar in it, and after trying Tutorial: a basic alternative layout from @Brian_Radspinner I am still at the beginning of my question.

I want to offer the user a simple possibility to switch the sidebar, as it is, from right to left and back. No changes to other settings of the story river it has to stay zoomin, classic or pop, whatever the user has set.
Maybe in a button within a tiddler named USER SETTINGS and each user can switch as wanted (until no reload is done of course).

Is that possible? Maybe with a really small macro or plugin. I checked also other layouts but they are overloaded with functions. I need it simple as it is.

Thank you for your support
Stefan

2 Likes

here, give this a try, this was given to me by another member (I think it was mario…? I’m not too sure :sweat_smile:) awhile back.

Something to note is that you’ll need to adjust the hamburger icon, but I like to think it’s a good KISS solution :grin:

\define config() $:/config/left-sidebar

\define controls()
<h2><$link to=<<config>>>Sidebar on left</$link></h2>
<$checkbox tiddler=<<config>>  tag="$:/tags/Stylesheet"> Side bar on left</$checkbox>
\end

\define styles()
<$let sidebarwidth={{{ [{$:/state/sidebar}match[no]then[0px]] ~[{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}] }}}>
.tc-sidebar-scrollable { left:0; margin:0; }
.tc-story-river { left:<<sidebarwidth>>; padding-right:42px; }
</$let>
\end

<$list filter="[<storyTiddler>!match[]]"><<controls>></$list>
<div style={{{ [<storyTiddler>!match[]then[display:none;]] }}}><<styles>></div>

<!--
"Title"="$:/config/left-sidebar"
"Tags"="$:/tags/ControlPanel/Settings"
-->
1 Like

The coding style looks like my stuff.

-e

3 Likes

Might have been, thinking about it- and thank you again, I found it while digging through old backups named SidebarOnLeft :grin:

1 Like


Only for notebook theme

Hi @Justin_H , @EricShulman ,

excellent, exactly what I was looking for.
Maybe it would be a good idea to change the code of the “hamburger icon” to toggle from left, right and off mode for the sidebar. Only an idea :slight_smile:

What I was able to to was to add another icon to the menu and to change the chevrons to hide and show the side bar

\whitespace trim
<$list filter="[[$:/state/sidebar]get[text]] +[else[yes]!match[no]]" variable="ignore">
<$button set="$:/state/sidebar" setTo="no" tooltip={{$:/language/Buttons/HideSideBar/Hint}} aria-label={{$:/language/Buttons/HideSideBar/Caption}} class="tc-btn-invisible tc-hide-sidebar-btn">{{$:/core/images/chevron-up}}</$button>
</$list>
<$list filter="[[$:/state/sidebar]get[text]] +[else[yes]match[no]]" variable="ignore">
<$button set="$:/state/sidebar" setTo="yes" tooltip={{$:/language/Buttons/ShowSideBar/Hint}} aria-label={{$:/language/Buttons/ShowSideBar/Caption}} class="tc-btn-invisible tc-show-sidebar-btn">{{$:/core/images/chevron-down}}</$button>
</$list>

<$tiddler tiddler="$:/config/left-sidebar">
<$button actions="""<$action-listops $tags="+[toggle[$:/tags/Stylesheet]]"/>""" tooltip="Toggle sidebar left/right" class="tc-btn-invisible tc-hide-sidebar-btn">
<$list filter="[{!!title}tag[$:/tags/Stylesheet]]" emptyMessage={{$:/core/images/chevron-left}}>{{$:/core/images/chevron-right}}</$list>
</$button>
</$tiddler>

<!--
name : $:/core/ui/TopBar/menu
tags : $:/tags/TopRightBar
-->

Thank you so far
Stefan

So, been a minute since I replied to this thread, but I finally finished my plugin for this specific feature, hamburger button and all!

$__plugins_tuna_sidebar-placement.json (6.2 KB)

Edit: Did not think about fluid-fixed, so this will likely be updated in the near future.

1 Like

i am new to Tiddly, sorry to ask, but where to put those code? create a new tiddler?

welcome to tiddlywiki then :smiley:

well, Instead of making a new tiddler, I would recommend clicking on the link in my latest reply, it should download all the needed tiddlers

https://talk.tiddlywiki.org/uploads/short-url/8Sy9aJXjIpqdOn9joenfYaOUnaD.json

Did this ever get updated with fluid-fixed considerations?

Hi RAG, welcome to TTW! Unfortunately no, last time I worked on it I think I got snagged on something I couldn’t figure out how to fix, but I will have to take another look at it and see where I left off at

1 Like

Ah, no worries! If you do manage to crack it I’ll be very grateful!

Hello @RAG
I am not sure if you are aware of the sidebar slider by @hoopyfrood, a part of the TW-EventCal which incorporates two buttons for Left and Right Sidebars.

Look at this non-JS Calendar discussion
It shows the required tiddlers that you need to add to your wiki if you want only want the sidebar change functionality.
Update
The config tiddler $:/plugins/SB-slider/config shows what tiddlers are required.
See this link TW-EventCal — Calendar displaying tagged events