Access "all[current]tagging[]]" in edit mode?

Hi all! Greetings from Houston, TX.

I have a tiddler with a list widget that I want to tag “$:/tags/EditTemplate” that will give me the tiddlers tagging the tiddler. I want it viewable in edit mode so I can open them from the tiddler in edit mode and untag them once I have manually inserted a transclusion to them in the tiddler. I have a feeling the “draft of” is somehow related but am not sure what to put. Any help?

In deed. I asked this question on gh just two weeks ago. if you agree with my request there, please make you voice heard:

@Springer was likewise suggesting not too long ago that we may need a new variable that refers to either {{!!draft.of}} (in edit mode) or <<currentTiddler>> (in view mode). But if you’d like a solution sooner than that, you can add your own variable with a function:

If you don’t foresee using this in other contexts, you can simply put the \function definition at the top of your EditTemplate rather than making it a global definition.

Then, instead of [all[current]tagging[]], use [<draftTiddler>tagging[]] or [tag<draftTiddler>] in your $list, and you’ll get the same results in either view or edit mode.

Edit: And of course, if you don’t care about view mode at all, you can skip the function and just use [{!!draft.of}tagging[]] or [tag{!!draft.of}] — though this will only work in your EditTemplate. :slightly_smiling_face:

3 Likes

I may be confused, but I’ve gotten the impression we should name custom functions so as to include a period.

Maybe this rule doesn’t really matter here, because the rule is really directed at filter operators, and this custom function is a simple variable (filter expression that operates without a further parameter)?

At any rate my variant of this solution uses cur.tiddler for this function, so that I can tag it with $:/tags/Global and keep in line with this norm.

I do like the idea that my all custom functions now include a period. I think it may help with my habits in the long term, because if I get used to typing cur.tiddler, I’m more likely to pause before using it in an off-the-shelf wiki. Or if I do use it out of habit, but it’s suddenly not working, I will recognize right away that cur.tiddler is unlike currentTiddler and storyTiddler (etc.,) in that it’s not part of the core.