TW5 multiple tag search using drop-down list

572 views
Skip to first unread message

Jon

unread,
Jul 25, 2016, 4:04:19 PM7/25/16
to TiddlyWiki
Hi,

I've searched through the forum so apologies if I've overlooked an answer previously given to this.

I'd like to set something up so that I can apply a filter using drop down lists of the available tags so I can then search for all the tiddlers tagged with both A and B by selecting each tag from the drop down list.

Hopefully that makes sense.

Thanks
Jon

Jed Carty

unread,
Jul 25, 2016, 4:22:18 PM7/25/16
to TiddlyWiki
You can look at the Bookmarks Sorted by Tags tab here to see an example.

Jon

unread,
Jul 25, 2016, 4:46:47 PM7/25/16
to TiddlyWiki
Thanks Jed, that looks like what I'm after but I'm afraid it's a bit beyond me - I've looked in $:/plugins/inmysocks/Bookmarks/Bookmarks by Tags, but I don't know what text to substitute for my own case eg. for <$set name=searchSelection value={{$:/state/Bookmarks/BookmarksByTags}}> ?

Jon

Eric Shulman

unread,
Jul 25, 2016, 5:46:29 PM7/25/16
to TiddlyWiki
On Monday, July 25, 2016 at 1:04:19 PM UTC-7, Jon wrote:
I'd like to set something up so that I can apply a filter using drop down lists of the available tags so I can then search for all the tiddlers tagged with both A and B by selecting each tag from the drop down list.

Using standard TiddlyWiki syntax (no plugins):



Find tiddlers tagged with:

<$select tiddler="$:/temp/tag1">
   
<$list filter="[all[]tags[]sort[]]">
     
<option value=<<currentTiddler>>><<currentTiddler>></option>
   
</$list>
</
$select>
and
<$select tiddler="$:/temp/tag2">
   
<$list filter="[all[]tags[]sort[]]">
     
<option value=<<currentTiddler>>><<currentTiddler>></option>
   
</$list>
</
$select>

Found <$count filter="[tag{$:/temp/tag1}tag{$:/temp/tag2}]" /> matching tiddlers:

<$list filter="[tag{$:/temp/tag1}tag{$:/temp/tag2}]">
   
<li><$link><<currentTiddler>></$link></li>
</$list>


enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios
InsideTiddlyWiki: The Missing Manuals

Matabele

unread,
Jul 26, 2016, 1:05:55 AM7/26/16
to TiddlyWiki
Hi Jon

I remember playing around with something like this using my $checklist widget -- have a look at the Select by ANDing Tags example here.

regards

Jon

unread,
Jul 26, 2016, 1:55:38 AM7/26/16
to tiddl...@googlegroups.com
That works Eric, thank you.

I wonder if the behaviour could be changed a bit so that the first selection shows the tiddlers with that tag and then the second selection shows the match- at the moment it will only show tiddlers with a match for both tags.

I suspect the next request might be less straight forward - it would be great to be able to type the name of the tag for it to be selected in the same way as the normal tiddler tagging mechanism. At the moment, typing will only reliably select the first letter of the tag and then you need to scroll.

Thanks Matabele - I'll look into that too.

Regards
Jon

Danielo Rodríguez

unread,
Jul 27, 2016, 3:42:36 PM7/27/16
to TiddlyWiki
There is a plugin that I have created for that purpose :

http://braintest.tiddlyspot.com/#TagsSearch-Plugin

Hope it still works.
Regards

Eric Shulman

unread,
Jul 27, 2016, 4:11:13 PM7/27/16
to TiddlyWiki
On Monday, July 25, 2016 at 10:55:38 PM UTC-7, Jon wrote:
That works Eric, thank you.

I wonder if the behaviour could be changed a bit so that the first selection shows the tiddlers with that tag and then the second selection shows the match- at the moment it will only show tiddlers with a match for both tags.

change the filter in the second select list from
<$select tiddler="$:/temp/tag2">
   <$list filter="[all[]tags[]sort[]]">
to
<$select tiddler="$:/temp/tag2">
   <$list filter="[tag{$:/temp/tag1}tags[]sort[]]">

Jon

unread,
Jul 27, 2016, 4:51:12 PM7/27/16
to TiddlyWiki
Perfect, thanks Eric.

Regards
Jon

Jon

unread,
Jul 27, 2016, 4:53:17 PM7/27/16
to TiddlyWiki
Hi Danielo,

I already had your plug-in installed but I couldn't manage to add another tag in the 2nd box...?

Regards
Jon

Danielo Rodríguez

unread,
Jul 29, 2016, 2:48:40 PM7/29/16
to TiddlyWiki
The first box is 'and' tags, the second one is to filter out results by text
Reply all
Reply to author
Forward
0 new messages