tags sorting and batch color editing questions

60 views
Skip to first unread message

Harry

unread,
Dec 13, 2020, 10:06:02 PM12/13/20
to TiddlyWiki
Hi all,

I have two novice questions. The first one is about batch editing tags. I have about 300+ tags now and I want to give them different styles (background color, text color, font size etc.) according to different groups. I have manually created a list of these tags' grouping as a simple search or alphanumerical ordering would not yield the particular result I want. Is there a way that I can create a list of 40 tag names and apply one same style to them in a batch operation?

My second question is about multilevel sorting. How should I sort the titles by two conditions. Say I want to sort all congressmen by birth year first, and for people born in the same year, I want to order them by death year. I tried tag[congress]sort[birth_year]sort[death_year] but it only return the result sorted by the last variable death_year.

I'd appreciate any help on these two questions!

Best
Harry


Mark S.

unread,
Dec 14, 2020, 10:09:34 AM12/14/20
to TiddlyWiki
On Sunday, December 13, 2020 at 7:06:02 PM UTC-8 Harry wrote:
Hi all,

I have two novice questions. The first one is about batch editing tags. I have about 300+ tags now and I want to give them different styles (background color, text color, font size etc.) according to different groups. I have manually created a list of these tags' grouping as a simple search or alphanumerical ordering would not yield the particular result I want. Is there a way that I can create a list of 40 tag names and apply one same style to them in a batch operation?

Do these tags exist as actual tiddlers? If so, then I would use Mohammad's Tiddler Commander to change color. If you create a tiddler like "mytags" and put all the tags in it that you want to have a new color, then in the TC filter box you could use a filter like "[list[mytags!!tags]] . Add a color field with the #ff0000 value (or whatever color you want). 

If all the tags are not tiddlers, then it's a fairly simple batch to create them.

I'm not aware of any standard way to change font style and text color of tags without hacking the core. But maybe someone else will.
 

My second question is about multilevel sorting. How should I sort the titles by two conditions. Say I want to sort all congressmen by birth year first, and for people born in the same year, I want to order them by death year. I tried tag[congress]sort[birth_year]sort[death_year] but it only return the result sorted by the last variable death_year.


Using 5.1.23 prerelease, you can make a filter similar to this example:

<$vars mysort="[get[birth-year]addsuffix{!!death-year}]">
<<list-links "[tag[congress]sortsub<mysort>]">>
</$vars>

This uses the new sortsub operator. The mysort filter for the sortsub operator has to be defined in the surrounding variables. The sortsub puts the birth-year and death-year together, and then uses that to sort by. I hope ;-)



Reply all
Reply to author
Forward
0 new messages