I found something interesting, looking at $:/core/macros/list
.
I’m still not sure how to apply what I’ve discovered, but I’m on the right track.
Editing list-tagged-draggable: (If I can find a solution I will make a new macro like “my-list-tagged-draggable” to not overwrite the core macro)
\define list-tagged-draggable(tag,subFilter,emptyMessage,itemTemplate,elementTag:"div",storyview:"")
\whitespace trim
<span class="tc-tagged-draggable-list">
<$set name="tag" value=<<__tag__>>>
<$list filter="[<__tag__>tagging[]search:title,caption:[pick]]" emptyMessage=<<__emptyMessage__>> storyview=<<__storyview__>>>
<$genesis $type=<<__elementTag__>> class="tc-menu-list-item">
<$droppable actions="""<$macrocall $name="list-tagged-draggable-drop-actions" tag=<<__tag__>>/>""" enable=<<tv-enable-drag-and-drop>>>
<$genesis $type=<<__elementTag__>> class="tc-droppable-placeholder"/>
<$genesis $type=<<__elementTag__>>>
<$transclude tiddler="""$itemTemplate$""">
<$link to={{!!title}}>
<$view field="title"/>
</$link>
</$transclude>
</$genesis>
</$droppable>
</$genesis>
</$list>
<$tiddler tiddler="">
<$droppable actions="""<$macrocall $name="list-tagged-draggable-drop-actions" tag=<<__tag__>>/>""" enable=<<tv-enable-drag-and-drop>>>
<$genesis $type=<<__elementTag__>> class="tc-droppable-placeholder"/>
<$genesis $type=<<__elementTag__>> style="height:0.5em;">
</$genesis>
</$droppable>
</$tiddler>
</$set>
</span>
\end
Here in the place of $subFilter$
I put search:title,caption:[pick]
as subfilter
<$list filter="[<__tag__>tagging[]search:title,caption:[pick]]" emptyMessage=<<__emptyMessage__>> storyview=<<__storyview__>>>
“pick” is just an example that works with the $:/tags/Macro
tag.
Now in the dropdown only the tiddlers that contains “pick” in their title or caption appear.
- Now what I must understand is:
-
I removed $subFilter$
from there. Could it be a problem?
(keep in mind that I would make this change in a “my-list-tagged-draggable”, not in the core marco. (I will only edit $:/core/ui/TagTemplate
to have “my-list-tagged-draggable” in the place of “list-tagged-draggable”)
-
How to put a variable in the place of “pick”. So I can choose every time the search imput from the tag-pill dropdown.
(Then it will only be a matter of editing $:/core/ui/TagTemplate
to have a collapsable search box inside, I already think I can do that easly) But I’m not familiar with variables so I’m stuck at the moment.
-
Can I use the “search” operator better?
(I never used it before and I did the most basic thing, probably it could be improved)
I hope these considerations can be useful