From 0a1152b83a56c49960d0b1d2c64deb043591b76d Mon Sep 17 00:00:00 2001 From: Marxsal Date: Sat, 10 Mar 2018 06:47:47 -0800 Subject: [PATCH] Simple methods to write protect tiddlers (#3163) --- .../Simple ways to write protect tiddlers.tid | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 editions/tw5.com/tiddlers/howtos/Simple ways to write protect tiddlers.tid diff --git a/editions/tw5.com/tiddlers/howtos/Simple ways to write protect tiddlers.tid b/editions/tw5.com/tiddlers/howtos/Simple ways to write protect tiddlers.tid new file mode 100644 index 000000000..0e2ffc8db --- /dev/null +++ b/editions/tw5.com/tiddlers/howtos/Simple ways to write protect tiddlers.tid @@ -0,0 +1,31 @@ +created: 20180310002601813 +modified: 20180310003428093 +tags: Learning +title: Simple ways to write protect tiddlers +type: text/vnd.tiddlywiki + +Sometimes you want to protect individual tiddlers from accidental changes, either from yourself or guests to your ~TiddlyWiki file. Here's a couple simple approaches. Note that these do not provide hardened protection against a wilful attack. + +!! Using a stylesheet to lock tiddlers by tag name + +Create a tiddler with the following contents and tag it as `$:/tags/Stylesheet` : + +``` +.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. + +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". + +!! Using transclusion to hide your tiddler in a system tiddler + +* 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 you can view the contents of your original tiddler, but to edit them your will have to find the the tiddler with the `$:/` prefix.