[tw5] Custom tags editor to block removal of specific tags

(If viewing this post in Google Groups, please ignore all triple backticks; they serve no purpose other than helping make sure content between leading and trailing backticks shows up correctly in Talk TiddlyWiki.)

In BASIC Anywhere Machine, I’m adding a tags editor to the “Program Properties” tiddler.

The “BAM” tag is a system tag, and I do not want BAM users removing that tag from “system” programs (these are BASIC libraries of code that are BAM components).

So I need a custom tags editor.

Because I do not like editing core tiddlers, I cloned the $:/core/ui/EditTemplate/tags tiddler, saving the clone as “BAM Tagging Tool”.

In the code, I changed the following in the “tag-body-inner” macro:

From:

<$button class="tc-btn-invisible tc-remove-tag-button" style=<<tag-styles>>><$action-listops $tiddler=<<saveTiddler>> $field=<<__tagField__>> $subfilter="-[{!!title}]"/>{{$:/core/images/close-button}}</$button>

To:
<$button **disabled={{{ [<currentTiddler>match[BAM]then[yes]] }}}** class="tc-btn-invisible tc-remove-tag-button" style=<<tag-styles>>><$action-listops $tiddler=<<saveTiddler>> $field=<<__tagField__>> $subfilter="-[{!!title}]"/>{{$:/core/images/close-button}}</$button>

In the “Program Properties” tiddler, I added the following line:
{{ || BAM Tagging Tool }}