Show all tiddlers with certain tags, as buttons in edittemplate tag picker?

Hi all

I have lately gotten such helpful replies to things I never thought possible, that it emboldens me to try one more. So if I am asking too much or too often, just tell me so. But remember that it is your fault for me asking, since you have all been so helpful. You drove me to request this!

One thing that frustrates me at times is that when I go to tag a tiddler, the tag chooser in edittemplate only shows me the already existing tags. But I have many tiddlers that could be tags but that aren’t yet. Sometimes I have gotten round this by creating a placeholder tiddler and manually tagging it with all the things I might ever want to show up in my edittemplate tag chooser.

Would there be a way to have all tiddlers tagged foo and all tiddlers tagged bar to show up as potential tags in the edittemplate tag chooser, even though they are not yet tags?

The tag-picker is pretty notoriously complicated and hard to tweak, so unfortunately, I don’t think it’s possible to do this without overwriting the core tiddler. If you don’t mind doing that, though, I just tried editing $:/core/macros/tag-picker to replace the line

nonSystemTagsFilter="[tags[]!is[system]search:title<userInput>sort[]]"

with

nonSystemTagsFilter="[tags[]!is[system]] [tag[foo]] [tag[bar]] +[search:title<userInput>sort[]]"

… and that seems to work. You could make the same change to the systemTagsFilter variable defined right below it, though I imagine you’re mostly concerned with content tiddlers!

(I’d naively hoped that it’d be as simple as editing the first-search-filter and/or second-search-filter fields already present on the tiddler, but they don’t seem to be actually invoked anywhere in the macro, though their default content does match the variable definitions. Perhaps we’ll see a simplified approach in the future!)

If you do overwrite the core tiddler, remember to check to see if the shadow version has changed when performing any future TW version upgrades. You can use the editor preview to see your changes at a glance:
image

If the core tag-picker is updated in the future, you may need to make the same change to the new version.

4 Likes

Thank you, Emily! That is exactly what I needed, and since this is a personal-only project, I am okay with editing a core tiddler. You have just made my life a lot easier! Blessings.

1 Like