Sorting tag pill list

I would like to sort the list of tiddlers that display when I click on a tag pill. Is there a way to do that? Specifically I’m looking to sort them by create date. I know how to do this when making my own like of tiddlers, but I don’t know what to change to cause the ‘tag pill list’ to sort that way.

My guess is that it is part of the ViewTemplate. I see a $:/config/ViewTemplateTagsFilters/default but it doesn’t appear to have any sort of filter expression in it.

The simplest way to change the sort order of the displayed tags is to edit the $:/core/ui/TagTemplate shadow tiddler, and change this line:

<$macrocall $name="list-tagged-draggable" tag=<<currentTiddler>>/>

to

<$macrocall $name="list-tagged-draggable" tag=<<currentTiddler>> subFilter="sort[created]"/>

-e

1 Like

Keep in mind the tag pill is designed to be a draggable list, so you can manually change the order. But it also honors list-before and list-after fields, Be carful on system tags like $:/tags/ViewTemplate

  • You could add a list to the tag pill drop down with a $:/tags/TagDropdown tag, on a tiddler that lists the items so tagged with a sort order. You will then have two lists (one sorted and not draggable)

I have a “filter pill plugin” soon to be published that you could use instead.

Note:
I think we should make it possible to edit the tag tiddler and specify the subfilter in a field, and have the core changed to check for the subfilter. It would make sense to map to Marios improved TOC (looking for link)

This works, thank you.

Manually sorting the list is good for one-off stuff, but because my wiki is more of a work diary, I want the entries to automatically sort based on date.

I will keep an eye out for your “filter pill plugin” though. That sounds interesting.