Is it possible to see a list of all tags with a count of how many times each tag has been used

For example, I can show all tags like so, but I want to see how many times each tag has been used.

<ul><$list filter={{$:/core/Filters/AllTags!!filter}}><li><$link /></li></$list></ul>

I believe you’re looking for the count widget.

<ul>
<$list filter={{$:/core/Filters/AllTags!!filter}}>
<li><$link /> (<$count filter="[tag<currentTiddler>]" />)</li>
</$list>
</ul>
1 Like

While @etardiff’s solution has an elegant simplicity, for a more advanced view of “tags with counts”, give TiddlyTools/Search/TagCloud a try. It offers interactive controls that let you:

  • select which tags to view
  • apply a filter to select which tiddlers to include
  • checkboxes to include [x]tiddlers [x]shadows [x]untagged
  • sort results by tag name or number of tagged tiddlers
  • show tag “pills” with automatic scaling based on number of tagged tiddlers
1 Like

Based on Emily solution you may like to have tags with higher counts first. Something very close to the tag cloud. This is a solution used in TW-Script TagCloud.


<$list filter="[subfilter{$:/core/Filters/AllTags!!filter}] :sort:number:reverse[tagging[]count[]]">
<<tag>>^^(<$count filter="[tag<currentTiddler>]" />)^^
</$list>

Which on tiddlywiki.com produces

3 Likes

Thanks @etardiff , I knew about the count widget but not how to combine it with the currentTiddler variable.

I’m not a big fan of tag clouds, but I do like tag clouds where the font size grows in proportion to the number of tags. Not sure if someone has made such a solution in TiddlyWiki.

markkerrigan
February 18

Thanks @etardiff , I knew about the count widget but not how to combine it with the currentTiddler variable.

I’m not a big fan of tag clouds, but I do like tag clouds where the font size grows in proportion to the number of tags. Not sure if someone has made such a solution in TiddlyWiki.

That is what Eric has made: See https://tiddlytools.com/#TiddlyTools%2FSearch%2FTagCloud

I’ll plug my own plugin here, tag-count:

https://benwebber.github.io/tiddlywiki-plugins/#tag-count

This adds the count to the tag pill itself. You can similarly list all tags like so:

<ul>
<$list filter={{$:/core/Filters/AllTags!!filter}}>
<li><$macrocall $name=tag tag=<<currentTiddler>> /></li>
</$list>
</ul>
2 Likes

I’m a personal fan of your plugin @benwebber, and I was a bit inspired by the [tw5] Simple Word Clouds post, where I made a filter you can use to sort your tags by how many tiddlers they tag, which pairs really well with your plugin.

“[tags[]!is[system]sort[title]]:sort:number:reverse[tagging[]count[]]” - The idea is to first sort it by title, then resort it by the tagging count, so tiddlers that have the same number of tiddlers they tag are alphabetized.

I use it in place of “{{$:/core/Filters/AllTags!!filter}}” in the tiddler $:/core/ui/MoreSideBar/Tags

2 Likes