Thread: List By Title
View Single Post
Old 11-12-2022, 10:19 AM   #14
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,488
Karma: 8065348
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
Alternately to {title}, I use this to display the first letter of the title.

Code:
{title_sort:'contains(t=uppercase(re($, '^\W*(\w).*$','\1')), '\d', '0-9', t)'}
How is this better than using {title_sort} with first letter grouping? Is it just the 0-9?

Also, why not make it hierarchical? Something like
Code:
program:
	ts = re($title_sort, '\.', ':');
	contains(t=uppercase(re(ts, '^\W*(\w).*$','\1')), '\d', '0-9', t) & '.' & ts
gives this
Click image for larger version

Name:	Clipboard01.png
Views:	45
Size:	26.9 KB
ID:	197678

EDIT: The initial re() is there to change periods to colons so they won't confuse the hierarchy.

EDIT 2: If you use standard first letter grouping then you don't need to change the periods or make the column hierarchical.

Last edited by chaley; 11-12-2022 at 10:34 AM.
chaley is offline   Reply With Quote