|
|
#1 |
|
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Jan 2022
Device: iPad
|
Book list template question
I am trying to update my custom book list template to show if a book has the Completed tag or not.
{tags} works fine, but I'm not interested in seeing the whole string, especially as it make take multiple lines. I have tried Code:
{str_in_list(field('tags'),',','Completed','Incomplete')}
Code:
{contains(field('tags'),'Completed','Completed','Incomplete')}
What nuance am I missing here? Last edited by BetterRed; 01-02-2022 at 09:07 PM. |
|
|
|
|
|
#2 |
|
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Jan 2022
Device: iPad
|
P.S. Hey, the word 'Incomplete' does not have spaces in it in either instance that I typed, but the forum software apparently knows better.
|
|
|
|
| Advert | |
|
|
|
|
#3 |
|
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 22,042
Karma: 30277960
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
|
|
|
|
|
|
#4 | ||
|
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:
What you probably want is: Code:
{:str_in_list(field('tags'), ',' ,'Completed', 'Complete', 'Incomplete')}
Code:
program:
str_in_list(field('tags'), ',' ,'Completed', 'Complete', 'Incomplete')
Quote:
Code:
program:
contains(field('tags'), 'Completed', 'Completed', 'Incomplete')
|
||
|
|
|
|
|
#5 |
|
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Jan 2022
Device: iPad
|
davidfor, thank you for your assistance, I am trying out your suggestions.
(It appears that my original post was edited to improve formatting and one of the 'Completed's was dropped along the way.) |
|
|
|
| Advert | |
|
|
|
|
#6 |
|
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Jan 2022
Device: iPad
|
(Partially) Solved!
OK, my major difficulty was trying to place the formula in the book list template itself - checking one of the 'related' threads reveals that the book list template does not evaluate expressions.
The solution is to create a custom column that evaluates to the desired value and putting the name of the column in the book list template: #status column contains template Code:
{tags:in_list($,', ',Completed,Complete,Incomplete)}
Code:
{#status}
|
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Custom list template | Laval | Related Tools | 6 | 10-11-2022 10:13 AM |
| Conditional statements or scripting in "Book list template" ? | Boilerplate4U | Calibre | 4 | 08-31-2021 12:53 AM |
| Template: Matching an entire list | ownedbycats | Library Management | 20 | 05-10-2021 12:08 AM |
| Book List question | Grenpa | Kobo Reader | 4 | 12-19-2014 09:21 PM |
| Create a template to only list one author. | PMGeuze | Calibre | 2 | 12-04-2013 03:53 PM |