One of the most often asked questions by new TiddlyWiki users is, “How can I get a list of all tiddlers with a particular tag?”.
Thanks to one of the new features in TiddlyWiki version 2.2.6, there is a very easy way to do it now. The filter tipped way.
TiddlyWiki has a ‘list’ macro, which has been extended to use the new filter syntax introduced in TiddlyWiki. How do you use it? It couldn’t be simpler:
<<list filter [tag[MyFavouriteTag]]>> generates a list of tiddlers with the tag MyFavouriteTag.
You could also do <<list filter [tag[MyFavouriteTag]] [tag[AnotherTag]]>> to get a list of tiddlers with the tag MyFavouriteTag or AnotherTag. However, currently a small bug will make a tiddler appear twice in the list if it has both tags. But do not despair! This will be fixed in the next release, hopefully along with another powerful feature, the ability to exclude tiddlers with a given tag.
What this means is that very soon you should be able, to do something like this:
<<list filter [tag[MyFavouriteTag]] [tag[AnotherTag]] [!tag[[NotThisTag]]>>
Please note the ! before the last tag, to imply that we do no want to include tiddlers with this tag. What this will give us, is an extremely powerful and versatile way of filtering and listing tiddlers by tags, without the need for any plugins!
8 comments ↓
Nice discovery, Saq - thanks for sharing!
Wow, great! That will greatly reduce my need for the ForEachTiddlerPlugin!
Dave: My thoughts exactly! While the ForEachTiddlerPlugin is a terrific plugin, given its hefty size, it is overkill for just listing tiddlers.
FND: My pleasure!
Is there any way to sort using <>?
Hi Saq
You wrote “What this means is that very soon you should be able, to do something like this: …”.
Is it available now or will it be available with TW 2.4.0?
Nice one,
I would like to see an “AND” construct as well, so that I can filter for a list of tiddlers matching “tag one” AND “tag two”.
EXCELLENT, do somebody have the time to report this on the official wiki [[tiddlyWiki Wiki|tiddlywiki.org]]
Thanks for the work! Filtering tiddlers for containing tag X and tag y would really be a great feature.
Leave a Comment