Sorry for the cross post on Github Discussions, thought this may be a more appropriate forum. Hello! new TW5 user and I am finding new ways of working I wish I had explored years ago. I am a tag heavy user and my workflow typically drills down to specific content.
Question: @tobibeer created TagFilter for TW 5.1.7 in 2015, does anyone know of this functionality in the current TW 5.2.4?
I did try to import the tagfilter macro in the TW 5.2.4 wiki and got some odd behavior which prevented its use. I really appreciate the dynamic nature of the macro to drilldown any tag levels, my own experiments have been predefined selects with limited depth.
It may help if you link to the GitHub Discussion you mentions.
Perhaps you could define what you would like rather than by reference to an existing example. There could be other ways to achieve the same thing.
;Notes
Following your link to TagFilter — dynamically filter by tags I see the filter there in is malformed [all[current[]tags[]]tagging:all[]] should be [all[current[]tags[]tagging:all[]]
I can imagine a recursive construction of the content of a select widget (untested)
If you are happy for the “drilldown multiple tag levels” to result in a “flat list” ie no grouping, the kin[operator] could retrieve this list.
Alternatively you could open a modal in which a Toc of the tag hierarchy was displayed and the selection(s) adds the selected tag(s).
The GIthub discussion I created has more details around an implementation thanks to @pmario.
Since I have found @bimlaslocator plugin which allows you to filter with a graphical user interface including Tags and drills down tags as you filter to the remaining available which I was looking to accomplish.
Thank yo @TW_Tones for your response I am seeing lots of additional tweaks to my workflow in the future.
I managed to create a filter that can list tiddlers containing all of the selected tags, you could use it to create a TagFilter macro:
* Write your filter/list of input tiddlers:
<$edit-text field="filter"/>
;Select tag(s)
<$let tags="[subfilter{!!filter}tags[]]">
<$select field="tag-selected" default={{{ [subfilter<tags>] }}} size={{{ [subfilter<tags>count[]] }}} multiple>
<$list filter=<<tags>> ><option>{{!!title}}</option></$list>
</$select>
</$let>
;Output (must have ALL of the selected tags)
<$let filter={{!!filter}} tag-selected={{!!tag-selected}} tag-selected-count={{{ [enlist<tag-selected>count[]] }}}>
1) Count the tags for each selected tiddlers
{{{
[subfilter<filter>]:map[{!!title}tags[]count[]]
}}}
2) Subtract the selected tags for each selected tiddlers:
{{{
[subfilter<filter>]:map[<currentTiddler>tags[]remove<tag-selected>count[]]
}}}
3) Count the difference
{{{
[subfilter<filter>]:map[{!!title}tags[]remove<tag-selected>count[]]
:map[subfilter<filter>zth<index>tags[]count[]subtract<currentTiddler>]
}}}
4) If it match the number of tags selected, select the tiddler
{{{
[subfilter<filter>]
:map[{!!title}tags[]remove<tag-selected>count[]]
:map[subfilter<filter>zth<index>tags[]count[]subtract<currentTiddler>]
:map[<currentTiddler>match<tag-selected-count>then<index>]
:filter[minlength[1]]
:map[subfilter<filter>zth<currentTiddler>]
}}}
</$let>
It’s not pretty but it works… We need a way to loop filters run dynamically, e.g: from a title list, apply each title as a filter in the form of [tag<title>]. It would render to tag<title1>tag<title2>tag<title3>, etc.