How to list number of occurrences of a particular field/value?

I have a growing TW of custom content for a game (The Sims 2/3/4), which has an “Author” field with the name of the creator of the particular item.

I’d like to create a tiddler with a list of all Creator’s, along with the number of items (tiddlers) ascribed to each one, with clickable links to each individual item.

I cannot simply search for their name, as it may appear in the text of other tiddlers from different creators, and I also have another field where their name may pop up, unrelatedly.

Although it would be much easier if the Creators were Tags instead of Fields, I already use the tag system to categorize the content (Clothing, Teen, Outdoor, Mod, etc.), and cannot change systems on the nearly 1000 tiddlers created thus far…

I know I really need to learn more about filtering, but it truly causes my head to spin every time I get into it (I just spent nearly 30 minutes figuring out how to create a has/!has list filter to use as an if/else filter…).

Any help greatly appreciated :slight_smile:

Welcome back to the forum, Chan_Droid !

Something like this, perhaps:

<$list filter="[all[tiddlers]each[author]get[author]]" variable="author">
  <<author>>   <$count filter="[author<author>]"/><br/>
  <$list filter="[author<author>]">

  </$list>
</$list>
1 Like

Ah, Mark beat me to it, but here’s a version with the authored content each under an HTML <details> tag, for less apocalyptic page-length (also author/content nsort (numerical sort) because I know some items will start with numbers)

<$list filter="[all[tiddlers]has[author]each[author]nsort[author]]">
<div class="tc-menu-list-item">

!!! <$view field="author"/>
<details>
<summary><$count filter=[author{!!author}] /> authored items</summary>
<$list filter="[author{!!author}!is[system]nsort[title]]">
<div class="tc-menu-list-subitem">
<$link to={{!!title}}><$view field="title"/></$link>
</div>
</$list>
</details>
</div>
</$list>

image

2 Likes

Thank You for the WB and the solution, Mark :slight_smile:

y’all are a bunch o’ geniuses! - Try as I might, I have never been able to make much sense out of these filters.

Think maybe I’m just getting too old to learn new stuff…

Many Thanks, @catter-fly - This is pretty much what I need :slight_smile:

I’ll have to do some ‘fiddling’ with it to adjust colors, and maybe some additional formatting, but the basics are here.

1 Like