![]() |
#1 |
Junior Member
![]() Posts: 9
Karma: 10
Join Date: May 2021
Device: Kobo Clara HD
|
Column from multiples, with added prefixes
So, I had a tags field with multiple categories of tags. I decided it would be more useful in sorting to split this out into custom tag-like columns for each category. However, I still want a 'tags' style column that combines them all for viewing and for generating Kobo collections. I also want to add the prefixes I was using before.
I have zero experience with coding, so I am fumbling through this stuff. I tried this out first, and it seemed okay enough. Code:
{tags:||, }{#ratingtags:||, }{#datetags:||, }{#authortags:||, }{#awardtags:||, }{#listtags:||, }{#wordcounttags} Code:
{#authortags:|author.|, } Code:
program:strcat(test(field('#authortags'), "author.", ""),re(field('#authortags'),", ", ", author.")) |
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
You can do this with a template like the following:
Code:
program: result = ''; result = list_union(result, list_re($tags, ',', '(.+)', 'tags.\1'), ','); result = list_union(result, list_re($#authortags, ',', '(.+)', 'authortags.\1'), ','); result = list_union(result, list_re($#ratingtags, ',', '(.+)', 'ratingtags.\1'), ','); result = list_union(result, list_re($#awardtags, ',', '(.+)', 'awardtags.\1'), ','); This template requires calibre 5.14 or later. NB: You can edit the template for the tags-like column using F2 (or whatever the edit key is on your system) in the library view. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Junior Member
![]() Posts: 9
Karma: 10
Join Date: May 2021
Device: Kobo Clara HD
|
This does exactly what I wanted, thanks so much! And thanks for the shortcut tip---I'd been going through the trouble of editing the column and restarting, and now I know the better way.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Date Added column? Can I set date when book added to library? | fitzhugh | Calibre | 4 | 06-03-2012 05:42 PM |
Custom column for date added | Gunnerp245 | Calibre | 2 | 07-08-2011 04:39 PM |
New added column is not shown as metadata | Tolkamp | Library Management | 5 | 06-18-2011 08:52 AM |
Custom column for book added | gandor62 | Library Management | 1 | 03-01-2011 06:58 AM |
stuck with recently added column | holterzoff | Calibre | 3 | 11-07-2010 06:47 AM |