Possible? Buttons to hide/show activate/deactivate some things on Wiki

642 views
Skip to first unread message

Surya

unread,
Mar 22, 2018, 7:07:59 PM3/22/18
to TiddlyWiki
Hello,

is it possible- and how to build it- to have two buttons:

1.: For activate/deactivate the (great!) plugin for preview of links (http://tobibeer.github.io/tw5-plugins/#preview)? So that, when deactivated, on the whole wiki there is no more preview of links. And, when activated, there is my normal setting of previewing links.


2.: For hide/show

Having these 2 buttons would be fantastic for me!!
Thanks in advance!! And have a good night,
Surya

TonyM

unread,
Mar 22, 2018, 9:28:12 PM3/22/18
to TiddlyWiki
Surya,

These would be easy to implement in MyMenus as menu items, I will see if I can do it for you and if you dont want to use a menu you can take the code from the menu items.

I still need to identify how to trigger the plugin disable button from a menu but a link to the plugin tiddler will allow you to hit the disable button.

Regards
Tony

TonyM

unread,
Mar 22, 2018, 11:56:41 PM3/22/18
to TiddlyWiki
Surya,

I have responded in detail to your request here http://tiddlywiki.psat.com.au/mymenus/#Surya's%20Menu , answered for a MyMenus solution.

However can you give more details about your item as follows?

You can already show hide the editor toolbar items for all tiddlers in Control Panel > Appearance > ToolBars > Editor Toolbar

However the buttons you mention are in the TiddlerToolbar 
You can already show hide the tiddler view toolbar items for all tiddlers in Control Panel > Appearance > ToolBars > View Toolbar


;The Side Editor Plugin
:Searching http://sideeditor.tiddlyspot.com I found a Tiddler $:/state/sideeditor that starts with the Value "About" then once toggled is either no or the selected tiddler.
:This would need a little more logic to set the statetiddler to no or <<currentTiddler>>


Regards
Tony

Surya

unread,
Mar 23, 2018, 8:52:26 AM3/23/18
to TiddlyWiki
Hi Tony,
I can give more detailed answer in a few hours.

But only for short now:
I think you missunderstood me a little bit.
For the mentioned 2. Button: I meant to have only ONE Button.
With that I could (I want) to hide /show the mentioned things with only one click.


Why do I want this:
A lot of visitors are irritated of these things. And these things are not for them- only for me, to be able to edit & work with that wiki.
When I go to this wiki I want to show everything mentioned with one click.
And when I leave it, I want to hide everything mentioned with one click.

Do you know what I mean?
Surya

Mat

unread,
Mar 23, 2018, 5:39:34 PM3/23/18
to TiddlyWiki
Yes, that is very doable.

You can use the ButtonWidget together with a few SetFieldWidgets to set the various states for those toggling things.

I also made http://toggle.tiddlyspot.com/ some time ago but it is made for toggling one thing - but you can remake it to include SetFieldWidgets.

<:-)

TonyM

unread,
Mar 23, 2018, 7:50:29 PM3/23/18
to TiddlyWiki
Surya,

As mat says you can set the tiddler states using a list of action widgets inside a button, but first of course you need to know which state tiddlers or tags to add/remove and I have provided the details for each of these. Except the items you raised, and added them to a custom menu (did you look at that?). I expect you will need two buttons, one to hide and one to unhide, that is in part why my solution was using checkboxes because they display the state and allow you to toggle the state.
Perhaps I have over answered, without giving you a "combined button" however I now have some additional "menu items" in the MyMenus Plugin.

Regards
Tony

TonyM

unread,
Mar 23, 2018, 8:05:57 PM3/23/18
to TiddlyWiki
Post Script,

The Checkbox widget 
actions New in 5.1.14 A string containing ActionWidgets to be triggered when the checkbox is clicked
.
Perhaps you could use this to trigger the aforementioned actions and the reverse, thus have a single checkbox.

Regards
Tony

Surya

unread,
Mar 23, 2018, 8:06:45 PM3/23/18
to TiddlyWiki
Hi Tony & Mat,

both are looking very interesting to me!! :-)
I am too tired for now, but will have a detailed look and play around with it tomorrow afternoon, when I am back home.
hihi- means giggling-........ I have now a button in another wiki called by me :-)

Surya

unread,
Mar 24, 2018, 8:17:17 PM3/24/18
to TiddlyWiki
Hello,

thanks for your suggestions! With both of them I already managed to show/hide
one menu of the MyMenus with
<$checkbox tiddler="Tiddlerfoot Menu" tag="$:/tags/mymenusfooter"> Show "Actions-Menu" in Tiddlerfoot</$checkbox>

and the MoreSideBar ($:/core/ui/SideBar/More) with
<$checkbox tiddler="$:/core/ui/SideBar/More" tag="$:/tags/SideBar"> Show "MoreSideBar"</$checkbox>

and the SideEditor in the tiddler toolbar with
<$checkbox tiddler="$:/config/ViewToolbarButtons/Visibility/$:/plugins/TWaddle/SideEditor/Button" field="text" checked="show" unchecked="hide" default="hide"> Zeige{{$:/plugins/TWaddle/SideEditor/Button!!caption}} button in Tiddlerview

and some other of the buttons in the tiddler toolbar. For example, the delete-button with
<$checkbox tiddler="$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/delete" field="text" checked="show" unchecked="hide" default="hide"> Show </$checkbox>{{$:/core/images/delete-button}} Delete-Button in Tiddlerview


Hiding specific tagged tiddlers I managed also by putting them into the MoreSideBar with this specific tag.



The rest I don't know how to manage:

@Tony: The
<$checkbox tiddler="$:/config/Plugins/Disabled/$:/plugins/tobibeer/preview" field="text" checked="yes" unchecked="no" default="no"> Disable Preview?</$checkbox>
to toggle the "preview tiddler-links" does not work...


Probably also @Tony:
I have a menu from your MyMenus with multiple actions / buttons in it (f.e. the "home"-button, the search-field, the button for the advanced search, the button to close all tiddlers, and some more).
And there I have also the button for the control panel ("Open the ControlPanel"). This button I also want to show/hide in this multiple-actions-menu by checking/unchecking such a checkbox. How can I do this?
I tried it with
<$checkbox tiddler="Multiple-Actions Menu for Sidebar" menu-item-5="{{$:/core/ui/Buttons/control-panel}}<br/>"> Show "Control-Panel" in Multiple-Actions Menu for Sidebar</$checkbox>
but it does not work.


@Mat & Tony & all:
And for last:
How to combine all (except the preview plugin) into only ONE checkbox?

Thanks, Surya

Surya

unread,
Mar 24, 2018, 8:36:51 PM3/24/18
to TiddlyWiki

I have a menu from your MyMenus with multiple actions / buttons in it (f.e. the "home"-button, the search-field, the button for the advanced search, the button to close all tiddlers, and some more).
And there I have also the button for the control panel ("Open the ControlPanel"). This button I also want to show/hide in this multiple-actions-menu by checking/unchecking such a checkbox. How can I do this?

Now I managed that too with
<$checkbox tiddler="Mehrfach-Aktionen Menu für die Sidebar" field="menu-item-5" checked="{{$:/core/ui/Buttons/control-panel}}<br/>" unchecked=" " default=" "> "Control-Panel" im Mehrfach-Aktionen-Menu der TopRightBar anzeigen</$checkbox>

:-)

Surya

unread,
Mar 27, 2018, 3:45:22 PM3/27/18
to TiddlyWiki
Hi,

I have now everything for hiding/showing, what I wanted:

<$checkbox tiddler="$:/core/ui/SideBar/More" tag="$:/tags/SideBar"> Die ▼ "MoreSideBar" anzeigen</$checkbox><br/>

<$checkbox tiddler="+Neuer Tiddler von Vorlagen (Menu)" tag="$:/tags/mymenusTopRightBar"> + "+Neuer Tiddler von Vorlagen (Menu)" inTopRightSideBar anzeigen</$checkbox>
<br/>

<$checkbox tiddler="Tiddlerfuß Menu" tag="$:/tags/mymenusfooter"> "Aktionen-Menu" im Tiddlerfuß anzeigen</$checkbox>
<br/>

<$checkbox tiddler="Mehrfach-Aktionen Menu für die Sidebar" field="menu-item-4" checked="{{$:/core/ui/Buttons/control-panel}}
<br/>" unchecked=" " default=" "> "Control-Panel" im Mehrfach-Aktionen-Menu der TopRightBar anzeigen</$checkbox><br/>

<$checkbox tiddler="$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/edit" field="text" checked="show" unchecked="hide" default="hide"> Zeige </$checkbox>{{$:/core/images/edit-button}} Editier-Button in Tiddlerview
<br/>

<$checkbox tiddler="$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/clone" field="text" checked="show" unchecked="hide" default="hide"> Zeige </$checkbox>{{$:/core/images/clone-button}} Klonen-Button in Tiddlerview
<br/>

<$checkbox tiddler="$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/delete" field="text" checked="show" unchecked="hide" default="hide"> Zeige </$checkbox>{{$:/core/images/delete-button}} Löschen-Button in Tiddlerview
<br/>

<$checkbox tiddler="$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/more-tiddler-actions" field="text" checked="show" unchecked="hide" default="hide"> Zeige </$checkbox>{{$:/core/images/down-arrow}} Mehr-Button in Tiddlerview
<br/>

<$checkbox tiddler="$:/config/ViewToolbarButtons/Visibility/$:/plugins/TWaddle/SideEditor/Button" field="text" checked="show" unchecked="hide" default="hide"> Zeige{{$:/plugins/TWaddle/SideEditor/Button!!caption}} button in Tiddlerview
<br/>
With this, every element I want to hide/show has its own checkbox.



Now I'd like to have them all in only ONE checkbox.
Means: If I check that ONE checkbox, all elements are hidden. If I uncheck it, all elements are shown.
How can I solve that? I couldn't find that out.


Thanks for your help :-)
Surya

Mat

unread,
Mar 28, 2018, 1:52:00 AM3/28/18
to TiddlyWiki
Unless I misunderstand you;

I think you must use a button an one setfieldwidget per state field. And revealwidget to make an on and an off button appear as one. I think using my

toggle.tiddlyspot.com

And adding all the setfieldwidhets is a good way.

Surya

unread,
Mar 30, 2018, 1:29:51 PM3/30/18
to TiddlyWiki
Hello Mat,

I guessed, it could be possible to combine them all in only one checkbox without any plugin. But maybe I am wrong...

If I am wrong with that, I would of course try to make it with your plugin :-)

But I have no idea how to combine the commands.
I couldn't find any example on your plugin-page...

Could you please explain it? Or build an example on your page?
Thanks! Surya

Jed Carty

unread,
Mar 30, 2018, 2:25:14 PM3/30/18
to TiddlyWiki
This is pretty much the same answer as I gave on the other thread, but the same idea works. You put in two action-setfield widgets for each thing you want to change, one to turn it off and one to turn it on. The states are separated by reveal widgets. I have an example showing how to add/remove a tag and to change a field because they are different, but you will have to add all the different things you want to toggle. You can put as many things as you want, put everything for the 'off' state in the first reveal widget and everything for the 'on' state in the second one.

<$button class='tc-btn-invisible'>
 <$reveal type='match' state='$:/plugins/tobibeer/preview/defaults/exclude' text='[all[tiddlers]]'>
 
<input type='checkbox'/>
  <$fieldmangler tiddler="$:/core/ui/SideBar/
More">
   <$action-sendmessage $message='tm-add-tag' $param="$:/tags/SideBar"/>
  </$fieldmangler>
  <$action-setfield $tiddler='$:/plugins/tobibeer/preview/defaults/exclude' text='[is[system]] [all[shadows]] [!has[text]]'/>
 </$reveal>
 <$reveal type='nomatch' state='$:/plugins/tobibeer/preview/defaults/exclude' text='[all[tiddlers]]'>
 
<input type='checkbox' checked/>
  <$fieldmangler tiddler="$:/core/ui/SideBar/
More">
   <$action-sendmessage $message='tm-remove-tag' $param="$:/tags/SideBar"/>
  </$fieldmangler>
  <$action-setfield $tiddler='$:/plugins/tobibeer/preview/defaults/exclude' text='[all[tiddlers]]'/>
 </$reveal>
</$button>

Surya

unread,
Mar 30, 2018, 4:08:46 PM3/30/18
to TiddlyWiki
Hello Jed,

I managed now to have all show/hide things by adding/removing tags with this one checkbox :-)

But: That tags that checkbox-tiddler himself with that tags. Why? How can avoid that behaviour?

And I couldn't bring it to work with the changing the text of some tiddlers.

I have written it like this now- what is wrong?
<$button class='tc-btn-invisible'>
 <$reveal type='match' state='$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/edit' text='hide'>
 
<input type='checkbox'/>

<$button class='tc-btn-invisible'>
 <$reveal type='match' state='$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/clone' text='hide'>
 
<input type='checkbox'/>


  <$fieldmangler tiddler="$:/core/ui/SideBar/More">
   <$action-sendmessage $message='tm-add-tag' $param="$:/tags/SideBar"/>
  </$fieldmangler>

  <$fieldmangler tiddler="+Neuer Tiddler von Vorlagen (Menu)">
   <$action-sendmessage $message='tm-add-tag' $param="$:/tags/mymenusTopRightBar"/>
  </$fieldmangler>

  <$fieldmangler tiddler="Tiddlerfuß Menu">
   <$action-sendmessage $message='tm-add-tag' $param="$:/tags/mymenusfooter"/>
  </$fieldmangler>

  <$action-setfield $tiddler='$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/edit' text='show'/>
 </$reveal>
 <$reveal type='nomatch' state='$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/edit' text='hide'>
 
<input type='checkbox' checked/>

  <$action-setfield $tiddler='$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/clone' text='show'/>
 </$reveal>
 <$reveal type='nomatch' state='$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/clone' text='hide'>
 
<input type='checkbox' checked/>


  <$fieldmangler tiddler="$:/core/ui/SideBar/More">
   <$action-sendmessage $message='tm-remove-tag' $param="$:/tags/SideBar"/>
  </$fieldmangler>

  <$fieldmangler tiddler="+Neuer Tiddler von Vorlagen (Menu)">
   <$action-sendmessage $message='tm-remove-tag' $param="$:/tags/mymenusTopRightBar"/>
  </$fieldmangler>

  <$fieldmangler tiddler="Tiddlerfuß Menu">
   <$action-sendmessage $message='tm-remove-tag' $param="$:/tags/mymenusfooter"/>
  </$fieldmangler>

  <$action-setfield $tiddler='$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/edit' text='hide'/>

  <$action-setfield $tiddler='$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/edit' text='hide'/>
 </$reveal>
</$button>



And I don't know how to build and integrate this one:

<$checkbox tiddler="Mehrfach-Aktionen Menu für die Sidebar" field="menu-item-4" checked="{{$:/core/ui/Buttons/control-panel}}<br/>" unchecked=" " default=" "> "Control-Panel" im Mehrfach-Aktionen-Menu der TopRightBar anzeigen</$checkbox>

Could you please explain?
Thanks! Surya
Reply all
Reply to author
Forward
0 new messages