How to get number of tiddlers tagged with the particular tag

677 views
Skip to first unread message

Jimmy Liew

unread,
Jul 3, 2014, 9:36:03 PM7/3/14
to tiddl...@googlegroups.com
Hi All,

I appreciate if anyone can help me with this simple tweak in TW5, to count the number of tiddlers tagged under the particular tag.

Currently I am using the following scripts to list all tiddlers that tags with the category, I wish I could have the total count state beside the category name.

<$list filter="[tag[category]sort[title]]">
<$link to={{!!title}}><$view field="title"/></$link><br>
</$list>


Thanks.

Stephan Hradek

unread,
Jul 4, 2014, 1:14:54 AM7/4/14
to tiddl...@googlegroups.com
You searched for "count" on tiddlywiki.com? You found this? http://tiddlywiki.com/#CountWidget:CountWidget

Jimmy Liew

unread,
Jul 4, 2014, 1:52:59 AM7/4/14
to tiddl...@googlegroups.com
Hi Hradek,

Thanks for your prompt response.  I added <$count> in the script and it shows unidentified.  Would you able to show me a complete example on how to do that?
Thanks

Stephan Hradek

unread,
Jul 4, 2014, 1:57:42 AM7/4/14
to tiddl...@googlegroups.com
Replace in your


<$list filter="[tag[category]sort[title]]">

$list with $count.

And don't forget the / before the >

Jimmy Liew

unread,
Jul 4, 2014, 2:20:08 AM7/4/14
to tiddl...@googlegroups.com
Hi Hradek,

I tried to include <$count/> in my script, see below.

<$list filter="[tag[archives]sort[title]]">
<$link to={{!!title}}><$view field="title"/></$link> (<$count/>)<br>
</$list>

But my output looks like this:
category 1 (undefined)
category 2 (undefined)
category 2 (undefined)

Matabele

unread,
Jul 4, 2014, 2:40:27 AM7/4/14
to tiddl...@googlegroups.com
Hi

Have a look at the code in '$:/core/ui/MoreSideBar/Tags':

<$list filter="[tags[]!is[system]sort[title]]">

<$transclude tiddler="$:/core/ui/TagTemplate"/>
<small class="tw-menu-list-count"><$count filter="[all[current]tagging[]]"/></small>

</$list>

regards

Stephan Hradek

unread,
Jul 4, 2014, 7:15:18 AM7/4/14
to tiddl...@googlegroups.com
Hi Liew,

You didn't do what I suggested. <$count/> does not define WHAT to count. Where is the filter attribute for <$count/>

Something like <$count filter="[tag[whatever]]"/>

Stephan Hradek

unread,
Jul 4, 2014, 7:16:53 AM7/4/14
to tiddl...@googlegroups.com


Am Freitag, 4. Juli 2014 13:15:18 UTC+2 schrieb Stephan Hradek:
Hi Liew,

You didn't do what I suggested. <$count/> does not define WHAT to count. Where is the filter attribute for <$count/>

Something like <$count filter="[tag[whatever]]"/>

I think the "title" is your "whatever", right? And the title is a tag?

So try  <$count filter="[tag{!!title}]"/>
Reply all
Reply to author
Forward
0 new messages