10-07-2024, 04:49 AM | #1 |
want to learn what I want
Posts: 1,260
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)} |
10-07-2024, 07:10 AM | #2 |
Grand Sorcerer
Posts: 12,029
Karma: 7257323
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; 10-07-2024 at 07:32 AM. Reason: Forgot to re-add < & > |
10-07-2024, 12:29 PM | #3 |
want to learn what I want
Posts: 1,260
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. |
10-07-2024, 01:39 PM | #4 |
Grand Sorcerer
Posts: 12,029
Karma: 7257323
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 |
10-07-2024, 01:54 PM | #5 |
want to learn what I want
Posts: 1,260
Karma: 6426810
Join Date: Sep 2020
Device: Calibre E-book viewer
|
Thanks, I'm going to use this to eliminate the redundancy
|
10-17-2024, 09:16 PM | #6 | |
null operator (he/him)
Posts: 20,998
Karma: 27620706
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
Is there a there a hidden table tool a'la Summernote BR |
|
10-17-2024, 09:48 PM | #7 |
want to learn what I want
Posts: 1,260
Karma: 6426810
Join Date: Sep 2020
Device: Calibre E-book viewer
|
It's a tweaked version of GR author notes plugin (Terisa has posted a fixed version here: https://www.mobileread.com/forums/sh...8&postcount=54).
I just edited a bit the html inside its authornotes.py and changed the plugin name to GR Author notes "2". Modified plugin is attached. I took a look at Summernotes and couldn't figure how to install it. In the past I'd use Macromedia Dreamweaver for stuff like this (I call it mixed code). This time I used a text editor and some (a lot of, actually...) Calibre restarts. And I had to tweak the BD styling with some negative margin: Code:
#_bio div {margin-left: -30px !important; } Last edited by Comfy.n; 10-17-2024 at 11:56 PM. |
10-17-2024, 09:58 PM | #8 |
want to learn what I want
Posts: 1,260
Karma: 6426810
Join Date: Sep 2020
Device: Calibre E-book viewer
|
Relevant code for the table is in lines 125-132:
PHP Code:
|
10-17-2024, 10:13 PM | #9 |
want to learn what I want
Posts: 1,260
Karma: 6426810
Join Date: Sep 2020
Device: Calibre E-book viewer
|
I have a modified tweak for BD font-size too:
# Change the font size of the Book details panel in the interface change_book_details_font_size_by = -1 |
10-18-2024, 02:11 AM | #10 | |
null operator (he/him)
Posts: 20,998
Karma: 27620706
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
I was hoping you'd found a table widget chaley had squirreled away in the long text editor Don't have time or inclination to be delving into rats nests of td, /tr, br etc tags when I want to insert a row in table, I'll stick to embedded onenote URLs.. BR |
|
10-18-2024, 02:35 AM | #11 |
want to learn what I want
Posts: 1,260
Karma: 6426810
Join Date: Sep 2020
Device: Calibre E-book viewer
|
Maybe a new feature for upcoming 7.21 version?
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem with title link custom column | SallyK | Library Management | 2 | 12-18-2020 09:00 AM |
Identifier-like custom column | nqk | Library Management | 5 | 05-20-2017 02:38 AM |
Custom Column to remember converted books | deadman36g | Library Management | 2 | 06-23-2016 05:22 PM |
Creating a Custom Column Link | a_daley | Library Management | 5 | 02-16-2014 06:56 AM |
Single column ePUB becomes 2 column when converted to Kindle (mobi) | rmcape | Conversion | 0 | 09-21-2013 01:52 PM |