Tiddler Rename inhibitor or warning

86 views
Skip to first unread message

TonyM

unread,
Jun 27, 2019, 1:19:20 AM6/27/19
to TiddlyWiki
Folks,

I am building a simple way to list tiddlers as tabs. For example
  1. All tiddlers tagged with the current one, 
  2. or with the current tiddler as its prefix,
  3. Tiddlers containing a field with the current tiddlers name in a custom field
  4. including what is often called a currentTiddler/subtiddler 
  5. or even looking for current tiddler with a prefix eg $:/lookup/currentTiddler (using the lookup operator)
  6. and eventually 
    1. tabs with Tiddlers containing a field with unique name in a custom field
    2. tabs named as belonging to the current Tiddler with a unique ID so they will remain after a tiddler rename.
For those familiar with the issues of renaming you will know the first 4 above are all fragile if you rename the root tiddler.

Until such time as a hook is provided to respond to rename events - I have asked for in the past.

I was thinking in many cases, the user may be happy not to rename a tiddler and break things, however there is always the danger of even an accidental rename.

This made me realise simply inhibiting the rename of a tiddler, or displaying a warning when about to rename the tiddler would be sufficient for most use cases.

Can anyone suggest 
How we may Inhibit or displaying a warning when about to rename the tiddler?

Thanks in advance
Tony

PMario

unread,
Jun 27, 2019, 3:33:33 AM6/27/19
to TiddlyWiki
On Thursday, June 27, 2019 at 7:19:20 AM UTC+2, TonyM wrote:
...
Can anyone suggest 
How we may Inhibit or displaying a warning when about to rename the tiddler?

Just create an EditTemplate, that checks for existing tiddlers and don't show the text-edit widget, if the tiddler exists. ... The problem is. ... Renaming will be much harder.

You'll need to clone a tiddler, if you want to rename it and then remove the "old" tiddler.

-m

TonyM

unread,
Jun 27, 2019, 5:31:53 AM6/27/19
to TiddlyWiki
Mario

Good idea. I was thinking of flagging the tiddler with a field. Perhaps I can modify the page template. Its ok if regular behaviour vs n be restored.

I will see if I can make a switch or hack we can include on nominated tiddlers. Perhaps rename, delete and edit inhibit should be part of this.

A batch process would also bypass this unless we can build something more robust.

Regards
Tony

PMario

unread,
Jun 28, 2019, 4:44:45 AM6/28/19
to TiddlyWiki
On Thursday, June 27, 2019 at 7:19:20 AM UTC+2, TonyM wrote:
...
For those familiar with the issues of renaming you will know the first 4 above are all fragile if you rename the root tiddler.

Until such time as a hook is provided to respond to rename events - I have asked for in the past.

There is a th-renaming-tiddler hook. .. But it has a problem. see: https://github.com/Jermolene/TiddlyWiki5/issues/4023

-m

TonyM

unread,
Jul 23, 2019, 8:26:35 PM7/23/19
to TiddlyWiki
Idea,

What if we could nominate fields that contain lists of tiddler titles such that they are included in the rename process?. For example currently the renaming of a tiddler used as a tag updates tags and list fields. What if the tiddler rename process also iterated other "nominated" fields and searched and replaced the current tiddler title in each of them?

I did request a tag for the inclusion of code in the edit template rename process Update New Tiddler test to New Tiddler test 4 in the tags and list fields of other tiddlers

But I don't know how to find if it was included.

Tony
Reply all
Reply to author
Forward
0 new messages