Can I write protect a tiddler

204 views
Skip to first unread message

Joe Armstrong

unread,
Mar 3, 2018, 4:48:14 AM3/3/18
to TiddlyWiki
I want to write protect a tiddler - is this possible - so I cannot accidently change it
is this possible?

/Joe

PMario

unread,
Mar 3, 2018, 6:31:26 AM3/3/18
to TiddlyWiki
On Saturday, March 3, 2018 at 10:48:14 AM UTC+1, Joe Armstrong wrote:
I want to write protect a tiddler - is this possible - so I cannot accidently change it
is this possible?

Hmmm,

IMO it's just an UI problem.

We are in javascript-world, where it's very hard to protect anything. ... So technically - it would be hard.

Practically, we can easily change the UI, if a tiddler eg: has a special tag or field.

So it will be easy to remove the "edit" button, if a tiddler has a field named eg: protected: yes

On the other hand, an editor / owner would need to have a UI, that doesn't care about the "protected" info, to be able to edit the stuff again.

It would be also possible to use every other field, that contains info, we can use to manipulate the UI.

have fun!
mario

Ste Wilson

unread,
Mar 3, 2018, 9:24:59 AM3/3/18
to TiddlyWiki
There was a password protect plugin for individual tiddlers posted somewhere on here...
I know that's not much help.

Mark S.

unread,
Mar 3, 2018, 12:31:55 PM3/3/18
to TiddlyWiki
If you just want to put the contents out of reach so that you don't clumsily change things (perhaps in a mobile situation) then you can use the excise tool.

Open your tiddler for editing.
Select the title and copy.
Select all the tiddler text.
Click on the excise tool.
In the title box, type $:/ and then paste the original title.
Use the defaults to excise and and leave a transclusion

Now the contents of your tiddler are safely tucked away in system file where you will have to spend some effort to get to them but won't find them by accident.

-- Mark

@TiddlyTweeter

unread,
Mar 3, 2018, 12:37:52 PM3/3/18
to TiddlyWiki
Ciao Joe

You can individually ENCRYPT tiddlers with password protection ... This would ensure you could not accidentally edit a Tiddler. It would be no use if you also need to access the Tiddler frequently though.

A plugin for that from Danielo: https://danielorodriguez.com/TW5-EncryptTiddlerPlugin/

I have NOT tested it on the latest TiddlyWiki release but usually previous plugins work fine.

Best wishes
Josiah

Joe Armstrong asked:

@TiddlyTweeter

unread,
Mar 3, 2018, 12:57:04 PM3/3/18
to tiddl...@googlegroups.com
Ciao PMario & Joe

Simply removing the edit button via tag field value WOULD be a practical solution for most use cases I think.

Sounds quite easy (though I wouldn't exactly know how to do it). FWIW, we talking about preventing accidental edit here, not security issues.

Anything needing more security and the existing solutions on encryption of individual tiddlers should suit.

Best wishes
Josiah

Mark S.

unread,
Mar 3, 2018, 1:40:36 PM3/3/18
to TiddlyWiki
Here's another quick way to protect yourself from yourself.

Create a tiddler called Locked Styles with the following contents

.tc-tagged-Locked button  {display: none;}

Tag it with $:/tags/Stylesheet

Now any tiddler you tag as "Locked" will have the edit button hidden. To get it back you will need to open the stylesheet tiddler and change "none" to "inline".

HTH

-- Mark


On Saturday, March 3, 2018 at 1:48:14 AM UTC-8, Joe Armstrong wrote:

@TiddlyTweeter

unread,
Mar 3, 2018, 1:54:31 PM3/3/18
to TiddlyWiki
++

Great tip.

passingby

unread,
Mar 3, 2018, 8:08:12 PM3/3/18
to TiddlyWiki
Mark both of your tips are wonderful. How does the second one work? How does the the css class .tc-tagged-Locked work? Second question is, when I tried this, it hid all the buttons, even the close button, 

Mark S.

unread,
Mar 3, 2018, 11:17:33 PM3/3/18
to TiddlyWiki
Oops. There's supposed to be class identifier for buttons, but it doesn't seem to work.

This seems to work, if you change the CSS selector:

.tc-tagged-Locked button[title="Edit this tiddler"]   {display: none;}

If your TW language isn't English, then you'll need to change the text in 'title="...."' to whatever the text is when you hover over the edit button.

When you tag a tiddler with something like "Locked", TW generates a CSS class and wraps the tiddler with the format "tc-tagged-<tag name>" where <tag name> is the name of your tag. Then you can use the generated tag name inside a stylesheet tiddler (any tiddler tagged with $:/tags/Stylesheet and containing CSS rules).

-- Mark

passingby

unread,
Mar 4, 2018, 12:27:21 AM3/4/18
to TiddlyWiki


On Saturday, March 3, 2018 at 9:17:33 PM UTC-7, Mark S. wrote:
Oops. There's supposed to be class identifier for buttons, but it doesn't seem to work.

This seems to work, if you change the CSS selector:

.tc-tagged-Locked button[title="Edit this tiddler"]   {display: none;}

If your TW language isn't English, then you'll need to change the text in 'title="...."' to whatever the text is when you hover over the edit button.

When you tag a tiddler with something like "Locked", TW generates a CSS class and wraps the tiddler with the format "tc-tagged-<tag name>" where <tag name> is the name of your tag. Then you can use the generated tag name inside a stylesheet tiddler (any tiddler tagged with $:/tags/Stylesheet and containing CSS rules).

-- Mark


Ah! yes. I see it in the inspector window. Good to know. Thanks!

Joe Armstrong

unread,
Mar 4, 2018, 11:04:47 AM3/4/18
to TiddlyWiki

Beautiful - very elegant - do you have a list of tips like this????

Very helpful for bears with little brains

Thank you very much

/Joe 

Mat

unread,
Mar 4, 2018, 12:17:19 PM3/4/18
to TiddlyWiki
Two alternative approaches:

1) Make the tiddler into a plugin. You can butcher up the shadow tiddler but revert back to original by merely deleting the mutilated version. I recommend the Tinka plugin for making plugins.

2) (super simple) Make the tiddler into a system tiddler, i.e merely title it e.g "$:/mytiddler". This, to some extent, hides the tiddler from public view. Then make a public tiddler e.g "mytiddler" that simply transcludes the system tiddler. 

<:-)
Reply all
Reply to author
Forward
0 new messages