Tiddlywiki: make a list of all tiddlers tagged with name of current tiddler
Asked Answered
B

3

10

If I have a tiddler named "X", I know I can make a list of all tiddlers tagged with "X" by using <<list-links filter:"[tag[X]] +[sort[title]]">>. Is there a way to make a no-brainer macro which automatically finds all tiddlers nested under the current tiddler without manually specifying the title field?

Boehmer answered 26/3, 2017 at 23:23 Comment(0)
B
13

Use this in your macro: <<list-links filter:"[tag<currentTiddler>] +[sort[title]]">>

Boehmer answered 26/3, 2017 at 23:23 Comment(0)
K
5

Or another one: <<list-links "[all[current]tagging[]]">>

Killjoy answered 12/6, 2017 at 23:13 Comment(1)
How does it work?Karlik
S
0

list-links is what it says on the tin, it returns a list of all links in the wiki. The filter then reduces it to links requested, and the sort arranges it into a desired order. The square brackets define what sequence is to be followed, clarifying the grammar. The OP'S question filters for particular tags (ie tag[ToDo] is a filter for tiddlers tagged with ToDo) which are then sorted by title into alphabetic order.

Likewise, in the second example, is a macro delivering the name of the current tiddler instead of the explicit name of the tag, so if the tiddler's name is ToDo then it will display the names of every tiddler marked ToDo. If you'd defined a ToDoPriority field in the tiddler definition, and sorted on that, you'd have an instant batting order. Job done, delete the tag, it's gone from the list.

And let's face it, if you need a priority list, you also need the opposite, automated prevarication, an identical tiddler named "Pending". You can even blame the computer. Computer he say, Rot in hell. The third case does the same with open tiddlers.

For a more general explanation, refer to Grok Tiddlywiki

Spina answered 5/6, 2022 at 17:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.