Tag chooser to insert tags in order to change a list-tags-draggable macro below it?

Hi everyone

I have the following macro <<list-tagged-draggable tag:"$tid$" itemTemplate:"$:/.giffmex/itemTemplate/for.draggable">>.

I would like to have a tag chooser to indicate what tag that should show instead of $tid$ in the macro. So if it were foo, I click on the foo tag, and the macro would display the listitemtemplate details for each tiddler tagged with that tag. And if I were to select a different tag, the tiddlers for that tag would show. Use case: a quick way to see the list and drag

How would I do that? Has anyone already done something similar? (I know that just clicking on a tag reveals a draggable list, but I want something big in order to see a certain field in the results.

Probably clear as a day for everyone else, but:

tag chooser

What’s that? Maybe a tag-picker (i.e what is seen in edit mode)? Or do you mean the titles in the dropdown when clicking a tag pill (as created by the macro call you show here?)

And what do you mean with:

indicate what tag that should show instead of $tid$ in the macro

Maybe you mean the items in a tagpill dropdown and that it should not show titles but rather some other info about that title (…but then what?)

How long is the list of tags that you would want to choose between?

Could be long. Maybe 100. Basically the entire tag list as it shows in edit template. I use CSS so that it is more than one tag per line.

It doesn’t need to be a layout with tag pills to filter and pick from. It could be some kind of search field where I type the name of the tag and when I match it exactly, the list of tiddlers tagged with that tag appears.

Yeah sorry I am horrible at explaining things.

Yes, something like tag-picker from edit mode. Or else a search box where I type a tag into a field and when I match a tag exactly the list of tiddlers tagged with that tag appears.

You can see I have $tid$ in the macro. So what I meant was, I need a way to tell the macro the tag I want to use to generate the list using the list-tag-draggable macro.

I have a listitem template that uses a link to the title (used for reordering) and a transclude inline of a custom field.

What you want is a place to choose a tag, which then gets saved to a tiddler say $:/tagviewer/selectedtag, and the value saved in that tiddler is what is fed to your macro:

<$transclude 
  $variable="list-tagged-draggable"
  tag={{$:/tagviewer/selectedtag}}  
  itemTemplate="$:/.giffmex/itemTemplate/for.draggable" 
/>

You could use a select widget, or a popup that looks similar to the one for choosing tags in edit mode. The former is simpler but probably less user friendly, and the latter is probably friendlier but would be more work to recreate without the parts that you won’t need.

The simplest possible way to get started would be an input field in which you need to type the exact tag to be used:
<$edit-text tag="input" tiddler="$:/tagviewer/selectedtag"/>

2 Likes

Thanks Saq! This is exactly what I was looking for. I marked it as the solution.

1 Like