Switching visibility of buttons

Hi all,

I am trying to write two buttons that switch the visibility of all ViewToolbar buttons on and off. They work for the buttons that are in the generated list, but not all buttons that are listed with the used prefix in the $:/core tiddler are found. For instance, the more-tiddler-actions button is not switched off. In fact, only three of the listed buttons are found: clone, close-others and delete. How can I fix this?

This is my code:

\procedure all-on()
<$list filter="[prefix[$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/]]">
<$fieldmangler>
<$action-setfield text="show"/>
</$fieldmangler>
</$list>
\end

\procedure all-off()
<$list filter="[prefix[$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/]]">
<$fieldmangler>
<$action-setfield $value="hide"/>
</$fieldmangler>
</$list>
\end

<$button actions=<<all-on>>>All buttons on</$button>

<$button actions=<<all-off>>>All buttons off</$button>

Adjusted list filter

<$list filter="[all[shadows]sort[title]prefix[$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/]]">

Is that what your going for?

Almost. The close and edit button are still there, but then these are not listed in $:/core with any ‘Visibility’ prefix, so your code does what it should do. Thanks!

Hello @SjaakA
as the edit button and close button are still shown, maybe you could consider the Read Only option for your TW.
Have a look at this Where are we at on Read-Only TWs? discussion. There are a number of options for doing this set-up.
You can configure the buttons as you like to show them.