[TW5] Hide Tiddler Toolbar items on select tiddlers

432 views
Skip to first unread message

TonyM

unread,
Aug 19, 2017, 8:26:43 AM8/19/17
to TiddlyWiki
Folks,

I will be presenting the nature of a project I am working on soon, but hope someone may be able to assist.

I would like to hide the edit button, or simply move it into "more" for individual tiddlers with a particular tag or field setting. Are there any masters of css or scripting that can suggest how?.

The reason is I have some "sophisticated" tiddlers who's content is mostly in tabs and sub tiddlers, there is no reason once they are created, necessarily to edit them but it is too easy to hit edit. I just want to hide (not stop access to the edit button) on select tiddlers.

Ideally I would be able to be selective rather than impact all tiddlers.

Thanks in advance
Tony

Mat

unread,
Aug 19, 2017, 9:43:22 AM8/19/17
to TiddlyWiki
1) Open the controlpanel and go to Appearence > Toolbars > ViewToolbar and uncheck the box for edit
2) have a nice cup of coffee

;-)  ;-)  ;-)

Selective is another matter. Would it be OK if you tagged those specific tiddlers? In that case it is achievable via css.

<:-)

TonyM

unread,
Aug 19, 2017, 7:42:53 PM8/19/17
to TiddlyWiki
Thanks Mat,

It is the CSS I do not know how to do it. Selective is the key. Thanks for validating the approach, but I do not know how to start.

Thanks
Tony

Eric Shulman

unread,
Aug 19, 2017, 8:04:31 PM8/19/17
to TiddlyWiki
On Saturday, August 19, 2017 at 4:42:53 PM UTC-7, TonyM wrote:
It is the CSS I do not know how to do it. Selective is the key. Thanks for validating the approach, but I do not know how to start.


1) create a tiddler, e.g [[noedit_stylesheet]], tagged with $:/tags/Stylesheet, containing:
.tc-tagged-noedit .tc-image-edit-button { display:none; }

2) edit any desired tiddler, add the tag "noedit", press "done" (the checkmark button)

Note: after you add the tag and press done, you won't be able to edit that tiddler anymore, so you won't be able to remove the tag you just added.  To edit "locked" tiddlers, you will need to disable the stylesheet definition (by removing the $:/tags/Stylesheet tag from the stylesheet definition tiddler).  Here's a quick checkbox that will toggle the stylesheet tag for you:

<$checkbox tiddler="noedit_stylesheet" tag="$:/tags/Stylesheet"> toggle "noedit" </$checkbox>

enjoy,
-e
Eric Shulman
TiddlyTools.com - "Small Tools for Big Ideas!" (tm)
InsideTiddlyWiki: The Missing Manuals


TonyM

unread,
Aug 19, 2017, 10:25:48 PM8/19/17
to TiddlyWiki
Thanks Eric,

That is most of the way, the toggle hides the image (rather than the button) so I am left with a small circle (perhaps because I choose the buttons with boarders) that looks like this 


Which actually would be fine, except I use the Edit Image in the "locked" tiddlers to allow edit of its sub-tiddlers.

So using this Hide Button Image I loose these buttons visibility as well.

I have also ensured a checkbox toggle of the noedit tag is available in "locked" tiddlers, as I am only trying to obscure not disable edit.

This is however a great start and I will go from here unless you know another approach?

Thanks
Tony

TonyM

unread,
Aug 24, 2017, 1:37:53 AM8/24/17
to TiddlyWiki
Folks,

Can someone please help me take the final step here, to somehow only hide or move to more, the edit button in the tool bar, and not in its other uses within my tiddler?

Or should I clone the edit tiddler button and use that in the tiddlers and Sub Tiddlers?

Thanks in Advance

RichardWilliamSmith

unread,
Sep 6, 2017, 12:45:09 AM9/6/17
to TiddlyWiki
Hi Tony,

Don't know if you ever solved this but better late than never if not. I hope you don't mind but I used it as an example on my new site (I plan to write a series of tutorials covering stuff like this) https://www.didaxy.com/selectively-hiding-the-edit-button-on-tiddlers and the explanation's there along with a "tl;dr"

Basically...

find $:/core/ui/ViewTemplate/title and swap this chunk

<$list filter="[all[shadows+tiddlers]tag[~$:/tags/ViewToolbar]!has[draft.of]]" variable="listItem"><$reveal type="nomatch" state=<<config-title>> text="hide"><$transclude tiddler=<<listItem>>/></$reveal></$list>


for this chunk

<$list filter="[all[current]tag[noedit]]"> <$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewToolbar]!has[draft.of]] -[[$:/core/ui/Buttons/edit]]" variable="listItem"><$reveal type="nomatch" state=<<config-title>> text="hide"><$transclude tiddler=<<listItem>>/></$reveal></$list> </$list> <$list filter="[all[current]!tag[noedit]]"> <$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewToolbar]!has[draft.of]]" variable="listItem"><$reveal type="nomatch" state=<<config-title>> text="hide"><$transclude tiddler=<<listItem>>/></$reveal></$list> </$list>

And then tag tiddlers "noedit" to hide their edit control. Obviously, make sure you back up your work first.

The longer instructions explain how I would go about doing this from scratch. Please let me know if you find a mistake.

Regards,
Richard

TonyM

unread,
Sep 6, 2017, 9:50:50 AM9/6/17
to TiddlyWiki
Richard,

That is the best answer anyone has given me to a tiddlywiki question - EVER. It supports the adage "the best way to learn is to teach" and it give me the information I need to set up a more structuresd solution to the original problem along with a deeper understanding to solve as yet unasked Questions.

Great work,

Dont hesitate to ask for my help developing material.

Regards
Tony
Reply all
Reply to author
Forward
0 new messages