Display tags in Tiddlers

965 views
Skip to first unread message

Jax Kovak

unread,
Apr 4, 2021, 8:02:03 AM4/4/21
to TiddlyWiki
Scenario: 
  • I have Tiddlers for each of a fairly large (and growing) group of people where the Tiddler name is the persons name.

  • Each of these Tiddlers is tagged with the same group ID tag (People).

  • The Name of each Tiddler (In the "People" Tag group) is then used itself as a Tag in multiple other Tiddlers, containing a variety of different project information that the Tagged person in the "People" group is associated with.

What I actually want:
In a new Tiddler I would like to be able to list all of the members of the "People" Tag group, in alphabetical order, as a list, but displayed as Tags themselves,.

Why?:
When we click on a Tag at the top of a Tiddler we can see a list of where that Tag occurs within the Wiki. Id like this functionality to be available to me in the confines of a Tiddler so that I can have a Tiddler that is an Index of all of the people, displayed as Tags, so that I can click on a name and see what projects that person is involved with, and can click to go to any one of them.

Of course I can get a list of the people, in order, make each item a link to the Tiddler of that person, etc etc, but so far I have failed horribly to make that list be a list of Tags rather than text and text links.

Many thanks for any help

JK

PMario

unread,
Apr 4, 2021, 8:42:57 AM4/4/21
to TiddlyWiki
Hi JK,

I did add a link to the macro-call widget, because it may be needed, if you want to call the tags macro in your own macros.

-mario

Jax Kovak

unread,
Apr 4, 2021, 12:46:38 PM4/4/21
to tiddl...@googlegroups.com
Hey PMario, thanks for that, but I'm confused on how to use this. Currently I can use 

<$list filter="[tag[People]sort[title]]"/> OR
<<list-links filter:"[tag[People]] +[sort[title]]">>

to get a list of the People in the People Tag group, but I can't see how to add the <<Tag>> to it so that each item is listed as a Tag. Could you clarify please?

Regards

JK


--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/uAM0RDmpfrE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/1baf4d5b-6d31-4b20-8122-dd35c531c962n%40googlegroups.com.

Eric Shulman

unread,
Apr 4, 2021, 1:09:28 PM4/4/21
to TiddlyWiki
On Sunday, April 4, 2021 at 9:46:38 AM UTC-7 isd196...@gmail.com wrote:
Hey PMario, thanks for that, but I'm confused on how to use this. Currently I can use 
<$list filter="[tag[People]sort[title]]"/>
to get a list of the People in the People Tag group, but I can't see how to add the <<Tag>> to it so that each item is listed as a Tag. Could you clarify please?

By ending the $list with /> you are using the "short-form" of the widget which, by default, outputs the titles of the matching tiddlers, as links.  To display other output (e.g., the title as a tag pill) you need to use the full <$list>...</$list> syntax, where the content is the <<tag>> macro, like this:

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

Note that inside the body of the $list widget, the value of currentTiddler is set to the title of each matching tiddler and the <<tag>> macro defaults to showing the "currentTiddler" as a tag pill.

enjoy,
-e

Jax Kovak

unread,
Apr 4, 2021, 2:16:28 PM4/4/21
to tiddl...@googlegroups.com
Eric, thanks so much! I wasn't sure about the short form of the list tag being used like that. Excellent! I have my list! Many thanks!

Kind regards

JK


--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/uAM0RDmpfrE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.

Jax Kovak

unread,
Apr 5, 2021, 3:11:35 PM4/5/21
to tiddl...@googlegroups.com
I have one final question, relating to the list function itself: Is it possible to split the list alphabetically? So that all people whose names begin with A, B, C etc, can be placed in separate lists, despite all being in the same Tag group?

Many thanks

JK

Anjar

unread,
Apr 5, 2021, 4:25:39 PM4/5/21
to TiddlyWiki
Hi,

Absolutely, here is a quick example:

<div style="column-count:3;column-rule: 1px solid lightblue;"><$list filter="A B C D E F G H I J K L M N O P Q R S T U V W"><h3><<currentTiddler>></h3><$list filter="[tag[People]sort[title]prefix<currentTiddler>]"> <<tag>> </$list></$list></div>

The div is just to get three columns. The first list loops through all the letters and print each letter (<<currentTiddler>>) as header. For each letter, you use the same list as before, but add a filter to only keep titles starting on (prefix) the given letter (note that we have to use <currentTiddler> inside filters)

Best,
Anders

Jax Kovak

unread,
Apr 6, 2021, 9:00:15 AM4/6/21
to tiddl...@googlegroups.com
Wow! Thanks very much Anjar. I was intending to have different tiddlers for different letters but this works even better and lets me see all of the names in a single Tiddler AND keeps them nice and tidy!

Excellent work!

Kind regards

JK


Stefan Schlechter

unread,
Apr 6, 2021, 11:59:12 AM4/6/21
to TiddlyWiki
Hello Anjar,

I've adapted your example to generate a list of all my Tiddlers + "published" field (= date):

<div style="column-count:2;column-rule: 1px solid lightblue;"><$list filter="A B C D E F G H I J K L M N O P Q R S T U V W"><h3><<currentTiddler>></h3><$list filter="[ sortan[]prefix<currentTiddler>]">  <small style="color:rgb(204, 204, 255)"> <<tag>> <$view field="published" /> </small> </$list></$list></div>

Is there a way to get an output list with only one Tiddler-title per line?

Thanks for feedback
Stefan

Jean-Pierre Rivière

unread,
Apr 6, 2021, 3:11:10 PM4/6/21
to TiddlyWiki
As for listing letters for entries I have tghe following:

\define all-initials()
<$list filter="[tag[glossaire]]">
   <$set name=1st value={{{ [all[current]split[]first[]] }}}>
      <<1st>>
   </$set>
</$list>
\end

\define glossaryList()
<$wikify name="all-letters" text=<<all-initials>>>
<$list filter="[<all-letters>uppercase[]split[É]join[E]split[]each:value[]!is[missing]]" variable="letter">
  <$link to=<<letter>>/>
</$list>

<$list filter="[<all-letters>uppercase[]split[É]join[E]split[]each:value[]!is[missing]]" variable="letter">
<h3><$link to=<<letter>>/></h3>
<$set name="entries" filter="[<letter>addprefix[{{]addsuffix[}}]]">
<<entries>>
</$set>
</$list>
</$wikify>
\end

added twist: make É and E the same entry. letters not used are not seen. This example is with a "glossaire" tag, you would use "people" instead or make it a variable of all-initials macro. the macro to be used is glossaryList (no argument).

You would have to adapt it to your needs and language perhaps.

note: I have created letterr tiddlers "A"', "B"', "C" etc before hand. I have not yet found out how to create them on purpose (and delete them on purpose too). But they all have the same content (a call to another macro). Some are not used, that's it.

Stefan Schlechter

unread,
Apr 7, 2021, 2:11:28 AM4/7/21
to TiddlyWiki
Thanks jn.pierr for your input - I'll check it later.
In the meantime I found a solution:

<div style="column-count:2;column-rule: 1px solid; color:rgb(204, 204, 255);">
<$list filter="A B C D E F G H I J K L M N O P R S T U V W Z">

<h3><<currentTiddler>></h3><$list filter="[ sortan[]prefix<currentTiddler>]">
<small style="color:rgb(204, 204, 255)"> <<tag>> <$view field="published" /> </small>
<br>
</$list>
</$list>
</div>

Stefan

Jean-Pierre Rivière

unread,
Apr 7, 2021, 3:42:10 AM4/7/21
to TiddlyWiki

Nice solution. I tried it. It is case sensible. My code is not (it was needed).

I will try to merge your solution into mine to see what I could achieve with two imbricated lists.

Jean-Pierre

Anjar

unread,
Apr 7, 2021, 8:29:41 AM4/7/21
to TiddlyWiki
Hi,

As you've discovered, seemingly simple problems can get wuite complex:) I agree with you that <br/> is a nice solution, or you could wrap it in a <ul> and have each element as a list item

For now, I was unable to find a simply way to substring the titles; if there was, you could get the first letter of all titles, make them uppercase, remove duplicates and iterate through them with match:caseinsensitive or something. Maybe it'll be possible in the future!

PS I forgot XYZ;)


Best,
Anders

mohamed maghrabi

unread,
Apr 19, 2021, 12:30:30 AM4/19/21
to TiddlyWiki
Is it possible to display all associated tags with the listed tiddlers next to them in the list?

Anjar

unread,
Apr 20, 2021, 7:16:46 PM4/20/21
to TiddlyWiki
Hi Mohamed,

I'm not sure I fully understand your question, but here is an example that produce a table with tiddlers (by letter) to the left and the tags of the tiddler to the right; perhaps you wanted the opposite..?

<table>
<$list filter="A B C D E F G H I J K L M N O P Q R S T U V W X Y Z">
<tr>
<th colspan = 2><<currentTiddler>></th>
</tr>
<$list filter="[ sortan[]prefix<currentTiddler>]">
<tr>
<td style="text-align:right"><<tag>></td>
<td><ul><$list filter="[title<currentTiddler>tags[]]"><li><<tag>></li></$list></ul></td>
</tr>
</$list>
</$list>
</table>

Best,
Anders

paulgilbert2000

unread,
Apr 21, 2021, 8:53:15 PM4/21/21
to TiddlyWiki
Thanks Anders

Close enough!

so i have this tiddler that lists other tiddlers matching certain Tag criteria , i also have some buttons and a drop list  , what i want is to add next to the buttons and the drop list all tags associated with these isted tiddlers

so this is how it looks like , i just need to add next to the droplists all tags associated with the test 2 for example , and preferably in the same pill format , hope this makes sense
Capture.PNG



Capture2.PNG

Anjar

unread,
Apr 22, 2021, 3:56:55 AM4/22/21
to TiddlyWiki
Hi,

Okay, I guess you have a list that produces that list of tiddlers, so just add <small><$list filter="[all[current]tags[]]"><<tag>></$list></small> in that list, after the code for the drop-list

Best,
Anders

paulgilbert2000

unread,
Apr 25, 2021, 10:26:44 PM4/25/21
to TiddlyWiki
This works thanks Anjar
Reply all
Reply to author
Forward
0 new messages