How to list tiddlers with tagname in the sidebar (Tricky single tiddler?)

Folks,

I just saw this opportunity for a single tiddler solution, which applies a few tricks I have gathered over the years.

It lists all tiddlers with a given tagname in its own sidebar tab.

tag-tagname.json (766 Bytes)

What is the trick?

  • It is a single tiddler with the title “tag: tagname”
  • Edit or clone it and simply rename “tagname” to your preferred tag.
  • All done!

Behind the scenes

  • It shows you how to extract the tagname from the title
  • But not until is gets the currentTiddler which is not available in the sidebar. Yes you could use <<currentTab>>however this demonstrates finding the “code tiddler in use”. #1
    • This tiddler works in the SideBar and the story.
  • It shows how to split a title to extract the suffix, in this case the tagname.
  • It shows how easy it is to add a button, to each list item, in this case to edit the tiddlers in the list.
  • You can also set the caption field if the tagname is too much for the sidebar.

So apart from what this single tiddler demonstrates its very convenient, just clone it, and rename to create another tab to quickly access your tag and the tiddlers so tagged.

#1. Code Tiddler in use
I will document more on this in another topic it’s quite a useful feature for design and debug.

1 Like

Sweet:

Giving back… :slight_smile:

For those that need caption or subtitle field support, modify Tony’s $list production like so…

<$list filter="[tag<tagname>sort[]]">
 <$let lnk={{{ [<currentTiddler>get[caption]] :else[<currentTiddler>get[subtitle]] :else[<currentTiddler>get[title]]}}}>
   {{||$:/core/ui/Buttons/edit}} <$link><<lnk>></$link><br>
 </$let>
</$list>
1 Like

Thanks @CodaCoder; This relates to the tiddler list

I will add something similar in a new version.

Some may prefer the TABS caption to not be the tag name as in the example $:/tags/ViewTemplate perhaps preferring “Views”.

If desired in replace the second half of the caption field
{{$:/core/images/tag-button}} {{{ [<currentTab>split[tag: ]last[]] }}}

{{$:/core/images/tag-button}} Macros