As this seems to be a relatively common question that has been asked before, I’m sharing my reply here:
First, edit shadow tiddler $:/core/ui/EditTemplate. In the “save-tiddler-actions()” macro definition, add <<save-tiddler-custom-actions>> just before the <<delete-edittemplate-state-tiddlers>>.
Then, create a new tiddler (e.g., “MyCustomSaveActions”), tagged with $:/tags/Global, and enter the following wikitext code:
Now, whenever the core save-tiddler-actions() macro is triggered by pressing the “done” button or by using the ctrl-enter keyboard shortcut, your save-tiddler-custom-actions() macro will also be invoked… and, if the tiddler is tagged with “Bookmark Tag”, the tm-add-field action will automatically add a view field containing [sort[title]].
Of course, this technique can be used to add all sorts of “automatically create/set a field” handling side effects when saving a tiddler… and, if you want to “automatically add a tag”, you can use a tm-add-tag message instead of (or in addition to) the tm-add-field message:
Edit: This Tix v0.10 — A Novel Tiddler Experience also popped up in a recent discussion about fonts, if you try to edit a tiddler, you will see multiple save buttons that work differently. I only bookmarked this, did not look at implementation yet, but perhaps @telmiger could comment on this.
While I’ve never used (and never will use) Discord, I don’t mind people using it for banter and private chats. Albeit I know one case when an unfortunate decision to completely shift the main place for community interaction from a classic forum to Discord (not the case of TiddlyWiki though) has ruined said community in one year. I’d like to think I’m not an anti-Discord zealot, yet when it’s about technical topics, that remains locked behind a gate and non-participants never get access to that knowledge.
I don’t think you need to worry about Discord replacing this forum; the Discord server actually predates Talk TW, and it hasn’t fractured the community yet. I’m a member of the server too, and Talk TW has always been substantially more active — and we regularly refer people here.
I suspect some people simply prefer the format (using Discourse on a phone is a headache!) or find it less intimidating to ask a question in Discord. Personally, I think it’s nice that TW fans can find a welcoming community no matter their preferred format!
You actually found my Edit Buttons plugin, available from Plugins — Utilities for TiddlyWiki. If you inspect the readme and the contents of the plugin you will find two buttons that save the tiddler AND do something else (close/reopen).
The relevant button code looks like this:
After the (draft !) tiddler is saved using <<save-tiddler-actions>> we have to retreive the title of the (now saved) actual tiddler and do something with it (re-open for editing in this case):
man, talk about lucky timing, I was just trying to recall how to do that, and this is a much better approach than i used in the past.
this will make adding revisions to tiddlers much simpler. (save tiddler increases revision field by one count each save, which is shown as a suffix to the subtitle using a modified versioning stylesheet from mr. TWaddle, in case anyone elses wants to do the same, you can find his stylesheet here)
The problem here is that when the <<save-tiddler-custom-actions>> macro is invoked, the value of currentTiddler is the draft title (i.e., Draft of "Some Tiddler Title"), so the prefix[...] filter does not match. To account for this, you could try using {!!draft.title} instead of <currentTiddler>, like this:
The purpose of variable=none is to prevent the $list widget from setting the value of currentTiddler based on the result of the filter. This permits the tm-add-field message to be applied to the fields of the draft tiddler (i.e., the currentTiddler) before it is saved to the “real” tiddler by the tm-save-tiddler message that follows it.