Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 02-07-2026, 06:19 PM   #1
slb
Junior Member
slb began at the beginning.
 
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.
slb is offline   Reply With Quote
Old 02-07-2026, 06:45 PM   #2
dunhill
Guru
dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.
 
dunhill's Avatar
 
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
dunhill is offline   Reply With Quote
Advert
Old 02-08-2026, 10:38 AM   #3
slb
Junior Member
slb began at the beginning.
 
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
slb is offline   Reply With Quote
Reply

Tags
calibre, costum column


Forum Jump

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


All times are GMT -4. The time now is 01:04 AM.


MobileRead.com is a privately owned, operated and funded community.