|
|
#1 |
|
Junior Member
![]() Posts: 9
Karma: 10
Join Date: Apr 2023
Device: none
|
Help needed for Custom Column
I've been struggling with the template language to make a custom column.
Any help would be appreciated. For sorting purposes I've created a custom column #sorttype. I want this column to show: if column #type has the value "Extra", show "Ebook" if column #type has the value "Bonus", show "Ebook" if column #subtype has the value "Chapter", show "Other" if not show the value in column #type Can someone give me the line that I simply need to copy and paste into the custom column template? Otherwise I fear, I will miss again. |
|
|
|
|
|
#2 |
|
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 995
Karma: 1084520
Join Date: Sep 2017
Location: Buenos Aires, Argentina
Device: moon+ reader, kindle paperwhite
|
I don't know if this will help, but try it and let me know.
Code:
program:
if field('#type') in ['Extra','Bonus'] then
'Ebook'
elif field('#subtype') == 'Chapter' then
'Other'
else
field('#type')
fi
|
|
|
|
| Advert | |
|
|
|
|
#3 |
|
Junior Member
![]() Posts: 9
Karma: 10
Join Date: Apr 2023
Device: none
|
Thank you.
I had just found a working solution. I've slightly changed it as I've changed the original metadata. template: program: test(list_intersection('Extra', field('#type'), ','), 'Ebook', field('#type')) With this my costum column #sorttype does this: if column #type has the value "Extra", show "Ebook" if not show the value in column #type |
|
|
|
![]() |
| Tags |
| calibre, costum column |
| Thread Tools | Search this Thread |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Using RE to extract pattern from custom column into another custom column | activedirectory | Library Management | 1 | 12-15-2019 09:07 PM |
| Move selected data from series column to a new custom column | fvdham | Library Management | 3 | 06-02-2017 04:49 PM |
| Custom Column not needed in other Libraries | MerlinMama | Calibre | 9 | 06-01-2016 09:09 PM |
| Custom column returns value based on value of another custom column? | calvin-c | Calibre | 3 | 09-14-2013 03:24 PM |
| Help needed with custom column in Calibre | PapaJohn | Library Management | 1 | 02-26-2011 03:41 AM |