Ciao Jeremy That is useful!
For instance I maintain a large set of movies and Title sort previously involved a more complex workaround for correct Title sort order. This will simplify things a lot! Just FYI I need to discard these types of definite & indefinite articles ... The, A, An, Die, Der, Das, Il, Ein, Eine, Lo, Le, La, Gli, L' etc etc Thanks TT On Tuesday, 17 November 2020 18:28:54 UTC+1, Jeremy Ruston wrote: > > One of my personal TiddlyWiki’s contains song lyrics and chords, with the > default tiddler displaying a list of the songs sorted by title. It’s been > annoying for a long time that the titles starting “The …” are sorted under > “T”, and not the first letter of the following word. > > The new sortsub operator in v5.1.23 has provided a simple means to resolve > things: > > \define sort-filter() [<currentTiddler>removeprefix[the ]] > ~[<currentTiddler>removeprefix[The ]] ~[<currentTiddler>] > > <$list filter="[tag[song]sortsub<sort-filter>]" > template="$:/_SongItemTemplate"/> > > > The subfilter relies on the fact that the removeprefix operator doesn’t > return anything if the input string doesn’t start with the specified > prefix. Thus we can step through the prefixes we want to remove, finishing > up with the original title. > > A more complete version should perhaps strip the prefix “A ” as well. > > It would be nicer if we have a case-insensitive version of removeprefix. > > Best wishes > > Jeremy > -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/ee10a091-dd40-4902-b814-0dc90c5d12c9o%40googlegroups.com.