Some filtering fun

38 views
Skip to first unread message

Charlie Veniot

unread,
Sep 27, 2021, 8:47:00 PM9/27/21
to TiddlyWiki
Over at TiddlyTalk, in the A list containing tiddlers with the same tags as current tiddler? thread, I had posted the following as my approach:

<$vars theseTags={{{ [<currentTiddler>tags[]sort[]join[,]] }}} >

<$list filter="[all[tiddlers]] :filter[tags[]sort[]join[,]match<theseTags>] +[!match<currentTiddler>]">
<$link/>
</$list>

</$vars>

That got me thinking: what if we wanted a list containing tiddlers with the same tags as current tiddler + 0-to-more tags ?

Say we also had Tiddler E with tags "topic a", "topic aa" and "topic b", and we wanted that to also be included when we look at Tiddler A?

Modified version of the code above:

<$vars theseTags={{{ [<currentTiddler>tags[]sort[]join[*]] }}} >

<$list filter="[all[tiddlers]] :filter[tags[]sort[]join[]regexp<theseTags>] +[!match<currentTiddler>]">
<$link/>
</$list>

</$vars>

Attached file has Tiddlers A-E, A being the one with the goodies.  Download and drag into any TiddlyWiki (TiddlyWiki.com!)
TiddlersAtoE.json
Reply all
Reply to author
Forward
0 new messages