I was wondering if there was a way to create a link to a tiddler that doesn’t break if the tiddler name changes. I wanted to create links to tiddlers from external applications (e.g. Microsoft Word, Teams, Anki). I can create permalinks but they seem to break if the name of the tiddler changes. I quickly skimmed through the following discussions:
Remember that permalinks can use any filter language, with a colon after the hashtag, like this: https://tiddlywiki.com/prerelease/#:[tag[About]] (not sure why this forum refuses to include the second closing bracket in the url — copy the whole url to clipboard, including second bracket).
So, if you can nail down anything that you know you’re not going to change in a tiddler (a certain field value, etc.) then you can build a permalink out of that.
Maybe you want to assign a field to this task. Call the field permalink or share or whatever, and give it a simple memorable value that expresses whatever will stay the same for you — even while your title(s) might change.
As suggested, you can use a url story filter to link to a tiddler or a set of tiddlers using the created field (or a custom field). You can create a toolbar button for this like this:
Nice and simple solution by @Theophile, I think it should suit most users.
Some general thoughts:
The created date is almost as unique as UUID, while also having a meaning. The only problem is if one creates many tiddlers at once in some automated process. In this case one would have to revert to creating an explicit UUID field. This has other issues though:
if all tiddlers are to be given a UUID at creation, it gets complicated with plugins and other modifications that give new ways to create new tiddlers, it will be difficult to keep track of it; but anyone who can view the wiki can create UUID-permalinks to it;
if tiddlers are to be given the UUID upon creating the permalink, it is easier to keep track of; but users with view-only rights will not be able to create these permalinks.
So in some situations the UUID field might be a better solution, but I would bet for most of the situations the simplicity of created date wins.
One small modification I’d consider for the created date permalink: use a filter like [created[XXXX]] [[Title]]. This means open tiddlers with this created date or with this title.
if the tiddler wasn’t renamed in the meantime, only it will be opened,
if the tiddler was renamed and no new tiddler with the original title was created, only the renamed one will be opened, as expected,
if the tiddler was renamed, and later a new one with the original title was created, both will be shown; I’d bet this will more often be wanted than unwanted,
this has the advantage of the link being human-readable and meaningful (contains title) without the need of applying any formatting/alias to it, wherever it will be used
the title operator is necessary to match only existing tiddlers “Title”, and not to display a missing tiddler if the tiddler was renamed.
This makes the link a bit less readable, but I think I’ve chosen the least confusing operator. Other options would be [match[Title]] or [[Title]is[tiddler]]. Or a custom functions like [.permalink[createdDate],[Title]] (if these work in url, I haven’t checked), but then the function must be always present and unchanged in the wiki, this would likely be a source of problem and not worth the marginally prettier url.
Thanks for the additional info. I didn’t consider creating many tiddlers at once in some automated process and how that might affect the toolbar button if I use only the created date.
I’ll add this to the solution @Theophile provided.
I have to correct myself once again, the [title[MissingTiddler]] is identical to [[MissingTiddler]], each will open the MissingTiddler even if it is missing.
To achieve what I was trying to do the filter would have to be [match[MissingTiddler]], [field:title[MissingTiddler]] or [[MissingTiddler]is[tiddler]] – these three will not open MissingTiddler if it is missing.
Here is @Theophile’s button with the updated filter, the whole filter expression will be [created[CreatedDate]] [field:title[Title]], of course you can use match or is[tiddler] just as well.