Here’s how I’d go about this with a slightly different technique:
<$button>
{{$:/core/images/new-button}}
<$list filter="[tag[@A]search:title[dictionary]]">
<$action-listops $tags="[[@Reference-Dicts]] -[[tag to be removed]]" />
</$list>
</$button>
I’m not sure whether you still want to display all the relevant tiddler titles if you’re using the single-button approach, but if you do, you could add <$link/>
inside the $list widget, or repeat the same list with links only outside the button.
The key difference here is that, unlike your original code and Eric’s, I’m using the $list inside the button, not outside, which lets me make a list of actions (or rather, the same action applied to many different tiddlers) rather than a list of buttons. I also switched out the $fieldmangler for $action-listops
, which takes the existing contents of a field (here, tags
in particular) and modifies it based on the filter you provide. This lets you add and remove tags in the same step if you so choose.
The minor downside is that when you supply action widgets inside a $button’s content, all the relevant filters get pre-calculated when the tiddler is first loaded, even if they don’t yield any visible content. If you don’t like this lag, you can move the $action-listops and its wrapping $list into a macro/procedure that gets called as part of the $button actions
:
\procedure retag()
<$list filter="[tag[@A]search:title[dictionary]]">
<$action-listops $tags="[[@Reference-Dicts]] -[[tag to be removed]]" />
</$list>
\end
<$button actions=<<retag>>>
{{$:/core/images/new-button}}
</$button>
Now all those $action-listops won’t get calculated until you actually press the button.
Finally, if you’re doing a lot of batch-processing like this, I highly recommend the Commander plugin, which gives you a ready-made UI for operations like this.