Today, 03:49 AM | #1 |
want to learn what I want
Posts: 1,184
Karma: 6426810
Join Date: Sep 2020
Device: Calibre E-book viewer
|
Dedicated identifier custom column converted into link
Hi,
I want to have a dedicated column for the Goodreads identifier, in order to display it in Book Details. I'm aware that {identifiers:select(goodreads)} can replicate the identifier in text form, however I wanted it to behave just like the default identifiers column, as it allows converting the identifiers into links. The default identifiers column has a clickable Goodreads link, however at the moment I'd prefer to have a dedicated one that can display just the GR link. I've tried... Code:
goodreads:{identifiers:select(goodreads)} |
Today, 06:10 AM | #2 |
Grand Sorcerer
Posts: 11,950
Karma: 7225107
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
I'm not sure what you want to display. Do you want "Goodreads" or do you want "Goodreads:12345"?
Assuming you want to see "Goodreads:12345" as a link and that the text column has "Contains HTML" checked, this should work: Code:
program: gr_id = select($identifiers, 'goodreads'); if gr_id then gr_id = 'goodreads:' & gr_id; l = urls_from_identifiers(gr_id, ''); l = re(l, '>goodreads<', '>' & capitalize(gr_id) & '<') else l = '' fi Code:
program: gr_id = select($identifiers, 'goodreads'); urls_from_identifiers('goodreads:' & gr_id, '') Last edited by chaley; Today at 06:32 AM. Reason: Forgot to re-add < & > |
Today, 11:29 AM | #3 |
want to learn what I want
Posts: 1,184
Karma: 6426810
Join Date: Sep 2020
Device: Calibre E-book viewer
|
And just like that, magic has happened. Thanks so much Chaley!
I think one of the reasons I want this, currently, is to leave more space for other items in Details panel! The first template looks nicer to me, though the second is enough for what I had in mind. |
Today, 12:39 PM | #4 |
Grand Sorcerer
Posts: 11,950
Karma: 7225107
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Given that screenshot I suspect that this template is more to your liking. The "Goodreads:" in the identifier is redundant, given the column name. This template shows only the identifier value without the "goodreads:" prefix. It is also slightly faster.
Code:
program: gr_id = select($identifiers, 'goodreads'); if gr_id then l = urls_from_identifiers( 'goodreads:' & gr_id, ''); l = re(l, '>goodreads<', '>' & gr_id & '<') else l = '' fi |
Today, 12:54 PM | #5 |
want to learn what I want
Posts: 1,184
Karma: 6426810
Join Date: Sep 2020
Device: Calibre E-book viewer
|
Thanks, I'm going to use this to eliminate the redundancy
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem with title link custom column | SallyK | Library Management | 2 | 12-18-2020 08:00 AM |
Identifier-like custom column | nqk | Library Management | 5 | 05-20-2017 01:38 AM |
Custom Column to remember converted books | deadman36g | Library Management | 2 | 06-23-2016 04:22 PM |
Creating a Custom Column Link | a_daley | Library Management | 5 | 02-16-2014 05:56 AM |
Single column ePUB becomes 2 column when converted to Kindle (mobi) | rmcape | Conversion | 0 | 09-21-2013 12:52 PM |