Proper way to use $:/tags/TagDropdown

103 views
Skip to first unread message

Rob Hoelz

unread,
May 7, 2020, 11:42:36 AM5/7/20
to TiddlyWiki
Hello TiddlyWiki users!

I have quite a few journal tiddlers - so many that clicking on the tag pill for the Journal tag lists far too many tiddlers.  What's worse, they're listed in ascending chronological order - most of the time if I'm browsing to a journal entry, it's going to be a recent one.

What I'd like is to customize how the dropdown for the Journal tag pill works - I'd like to show only the most recent 14 or so entries (perhaps the 7 before and after the current tiddler if the current tiddler is itself a journal tiddler), and I'd like to show them in reverse chronological order.

To see how feasible this would be with minimal overriding of shadow tiddlers, I was digging around in the source, and I stumbled upon $:/tags/TagDropdown.  The documentation on https://tiddlywiki.com for this says:

The system tag $:/tags/TagDropdown marks tags dropdown sorting

 This sounds promising!  However, I can't find any examples of how to use this tag.  Could someone point me in the right direction?

Thanks,
Rob

TonyM

unread,
May 8, 2020, 4:44:45 AM5/8/20
to TiddlyWiki
Rob,

A Tiddler tagged with $:/tags/TagDropdown will appear when you click on a tag pill. I am working something right now that makes use of this fact however your use case it not the best way to tackle this because the tag pill is about tag pills and is a popup for their management. Its all fine for you to change this but you may interfear with its normal use. There are many other ways to sort and list tiddlers. Perhaps a convenient one would be to place an appropriate list widget in a tiddler and tag it with $:/tags/SideBar to you have a tab listing such journal entries. Alternativly you could look at the recent tab, and create a clone which filters out tiddlers without a journal tag tso this lists journal entries in date order (modified).

Your list can make use of the days operator to get relative dates, however sadly the default journal tiddler often only has the date in the title, or the created date. Personaly I use a modified new Journal, and New Journal here button that adds the field journal-date at creation time which I use for more sophisticated searches, and yes I can backdate a journal entry using the pickaday plugin to enter /change dates.

See the attached hacked New Journal button (it was hacked in an earlier version) for recent versions import the tiddlers in NeWJournals2020release, I discovered a small inconsistency in recent upgrades while doing this.

Not withstanding my aversion to using tag pills for another purpose I am looking at making use of the tagging mechanism for something soon, I will keep your requirement in mind when working on that.

Regards
tony
$__core_ui_Buttons_new-journal.json
NewJournal2020release.json

Rob Hoelz

unread,
May 8, 2020, 2:57:01 PM5/8/20
to TiddlyWiki
Thanks, Tony! You've inspired me to try a different approach - I can just add a ViewTemplate tiddler for journals to model the behavior I need.

So it seems to me that TagDropdown doesn't have anything to do with sorting the tagged tiddlers after all - maybe the documentation could use some improvement there!

-Rob

TonyM

unread,
May 8, 2020, 6:20:21 PM5/8/20
to TiddlyWiki
Rob

You can change the order of items in the tag drop down with manual drag and drop. However this operates on all tiddlers so tagged. Ie no additional filters are applied. It is best to use other mechanisiums where you have much more control my favorite being the list Widget. As you say placing that in a tiddler tagged to appear on tiddlers via the view template is perhaps the best way to overlay more than one tiddler with additional features in view mode.

Regards
Tony

Reply all
Reply to author
Forward
0 new messages