How can I make a list that displays both the title of the tiddlers and, based on the value of a field, an icon alongside

I’ve been trying to to this for a while, but I guess I need some guidance:

I would like to create a list of tiddlers like this:

Basically just a list of titles of tiddlers found by a filter (like <$list filter="[tag[TableOfContents]]" template="$:/core/ui/ListItemTemplate"/>) but with the addition, next to the title of something (like an icon) that varies according to the value of a particular field.

I just need some pointers/tips. I think and hope that I can manage, but I don’t know where to start. Any ideas?

-Sam

Perhaps don’t use a template

<$list filter="[tag[TableOfContents]]">
   <$transclude tiddler={{!!icon}}/> <$link/><br>
</$list>

The content of the list widget is the template.

1 Like

Sam,

I highly recommend linkstyle by @twMat

Its demo page is here: http://linkstyle.tiddlyspot.com/

While its uses there may seem mostly decorative, I use it a great deal for dynamic and complex info that I want to display next to links. Then, given that you can activate the setting to have TW display all titles as links, I find I hardly use tw’s built-in icons anymore at all, since linkstyle is more powerful.

For example, on my google-fonts for tiddlywiki site, what’s actually going on virtually everywhere is just links and lists of links. All the text styling and before-and-after info (including dynamic counts like you see after “quick picks”, and anything else you can specify with a filter operation) is accomplished with linkstyle:

Here’s a good tiddler to poke around with, and follow some links, to see a variety of ways the custom fields (linkstyle and linkstyle-before and linkstyle-after) can work to display info, icons, etc:

https://google-fonts.tiddlyhost.com/#TableOfContents

-Springer

2 Likes

Yes, in fact what I used in the example I had blindly taken from the main site, I wouldn’t have used it in mine, but I could have, thanks for the clarification :grinning_face_with_smiling_eyes:

I’m looking at it and it looks really promising. It will take me a little bit to study it well, but this may be the solution. In the meantime, thank you! :grin:

I think in the end for what I want to do I’ll keep it simple and I’ll do something similar to what you @TW_Tones advised, although as far as linkstyle is concerned, it’s really nice and I’ll use it for sure, but not in that context (that of simple lists). Thank you again @TW_Tones and @Springer!

1 Like