![]() |
#1 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,974
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Template: Show only first value in a taglike
I have this template in KoboTouchExtended's subtitle field:
Code:
program: if field('#serieslike') then template('{#serieslike} #{#serieslike_index:0>2s}') else if field('#taglike') then template('{#taglike} | {#enum}') fi fi This works as expected. However, I noticed books with multiple values in #taglike tend to cause the subtitle length to overflow on my Kobo. So I'd like it to just display the first value. How do I do that? ![]() Last edited by ownedbycats; 01-16-2021 at 05:12 PM. |
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Use
Code:
{#taglike:sublist(0,1,\,)} |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,974
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
I noticed that in Edit Metadata and the book details they appear in alphabetical order, though that might be FanFicFare's doing. Thank you!
|
![]() |
![]() |
![]() |
#4 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
If it turns out the values are not sorted and if it matters then this TPM template takes care of it Code:
{#taglike:'sublist(list_sort($, 0, ','), 0,1,',')'} |
|
![]() |
![]() |
![]() |
#5 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Quote:
I'm not a fan of this, and have removed the sorting of tags from all the places in calibre that sorts them that I could find. If I ever get around to rewriting the tag editor to allow ordering, I might see about adding it as a tweak. |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,974
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Code:
program: if field('#readorder') then template('Reading List: {#readorder} #{#readorder_index:0>2s}') else if field('#fanficcat') then template('{#fanficcat:'sublist(list_sort($, 0, ','), 0,1,',')'} | {#fanficstatus}') fi fi Last edited by ownedbycats; 01-16-2021 at 09:05 PM. |
![]() |
![]() |
![]() |
#7 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Code:
template("{#fanficcat:'sublist(list_sort($, 0, ','), 0,1,',')'} | {#fanficstatus}") Code:
strcat(sublist(list_sort(field('#genre'), 0, ','), 0,1,','), ' | ', field('author')) |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to show tag browser | nepentanova | Calibre | 5 | 03-26-2019 05:59 PM |
How to show books with only 1 tag? Dynamic tag or virtual library? | cd2013 | Calibre | 4 | 03-01-2019 06:41 PM |
Show Category in Tag Browser | MerlinMama | Calibre | 4 | 02-01-2016 11:11 AM |
I want Calibre 64bit to only show the tag selected | hola!claude | Library Management | 3 | 12-22-2014 05:14 AM |
template: if one of the tag is something... maybe contains or in_list functions | fxp33 | Calibre | 4 | 07-19-2014 05:18 AM |