![]() |
#1 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 260
Karma: 139980
Join Date: Mar 2014
Device: Android
|
Author Mgmt -Links field/column Lookup Name?
I'm trying to get this field to print in a template. However, I cannot figure out the {LookupName} to use.
I have searched the manual and many other places but cannot find or figure out field names beyond the other basics like {author}, {series}, {series_index}, etc... Kovid, it would be great if there was a straight listing of these somewhere in the manual ![]() |
![]() |
![]() |
![]() |
#2 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 435
Karma: 572984
Join Date: Jan 2010
Location: Long Island
Device: Kobo Libra 2, Kindle 4, Nook Gl4, Nook STR, REB 1100, Ebookwise 1500,
|
Take a look at this post: https://www.mobileread.com/forums/sho...5&postcount=10
Unless something changed in 2.0 there is no direct access to it other than Manage Authors, but Chaley added a bit of a workaround to get to the information. I admit most it is over my head but you might find it useful. |
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,318
Karma: 7975240
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
|
|
![]() |
![]() |
![]() |
#4 | |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 435
Karma: 572984
Join Date: Jan 2010
Location: Long Island
Device: Kobo Libra 2, Kindle 4, Nook Gl4, Nook STR, REB 1100, Ebookwise 1500,
|
Okay, I'm really confused now. In the referenced post you said,
Quote:
|
|
![]() |
![]() |
![]() |
#5 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,318
Karma: 7975240
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
What you cannot do is use a template function or extended template syntax directly in a jacket. In other words, you can use {foobar} but you cannot use {foobar:function()}, {foobar:|prefix|suffix}, or "program: bla bla". This means you cannot use formatter functions to generate html in templates, for example to create author links. As far as I can tell any HTML in a column will be displayed as text, not interpreted as HTML. I confess I haven't tried it, but the code "escapes" the contents of custom columns, which I think converts HTML to text. |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 435
Karma: 572984
Join Date: Jan 2010
Location: Long Island
Device: Kobo Libra 2, Kindle 4, Nook Gl4, Nook STR, REB 1100, Ebookwise 1500,
|
I think I understand now. You can use a function in a composite column and you can use it in a template, you just can't use it to return functioning HTML (ie a working hyperlink). Yes?
|
![]() |
![]() |
![]() |
#7 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,318
Karma: 7975240
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
There are two kinds of templates in calibre, mostly due to history. The first kind, {name}, is what we might call a basic template that means replace itself with the value of the field/column/variable "name". These templates are used in jackets and catalogs, and perhaps other places that I don't remember. The second is template-language templates. These are the templates described in calibre's documentation The calibre template language. These templates are used in composite columns; save-to-disk templates; send-to-device templates; (as of calibre 2.1) catalog section templates; and column coloring , column icon, and cover view emblem advanced templates. The issue of returning HTML is not directly related to templates of either kind, but is instead related to where the templates are used. Jackets use basic templates and furthermore "escape" the value returned by composite columns so (I think) that HTML in a composite column won't work. However, catalog sections use template-language templates and do not escape the value so columns can contain HTML that will be used. HTML can be used in columns that are displayed in book details. And perhaps in other places. And yes, all of this should be harmonized. Unfortunately doing so would certainly break existing setups, which would result in a large support load. As an example, consider the title/title_sort stuff in save-to-disk templates. Historically, in those templates {title} has meant {title_sort}, and changing that could adversely affect millions of people. So instead a tweak was added to permit someone to tell calibre that the person wants different behavior. Catalogs and jackets have similar issues. |
|
![]() |
![]() |
![]() |
#8 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 260
Karma: 139980
Join Date: Mar 2014
Device: Android
|
Thank you, both. I think I better understand this now. @Chaley, your first reply clicked for me finally. I think you tried to point this out for me in another post where you thought I spoke of catalogs, but I couldn't put those pieces together.
@Chaley, So, this makes me wonder about a workaround that might work like this if I could just learn the reference field name? Based on what I've read: I'm thinking I could create a custom column (composite?) that returns the author links info. Then I could reference my custom column in the template as I did with some other custom columns that worked. Does this sound doable to you IF I can find out the field reference name? I'm going to play a little and try the same tags I originally mentioned. I will only post back shortly if they actually work. No post means I'm still wandering..... To be clear, I understand from your well-formed reply that it cannot generate as an active link. In fact, in some cases that attempt would be bad where I've stored more than one link associated with the author (yes, this can be desirable). Many e-reader apps allow a copy past of text which is one way to follow the info generated. Just a note on the "why don't you just..." thoughts for those who might have them: I don't put make a custom column with the links entered manually even with auto complete available because I would have to do them each time a book is added. I know I can group the entries and then enter once, but that is still cumbersome and doesn't take care of everything in one fell swoop that I can then Polish and included in metadata jackets. MY UNDERSTANDING is that the custom column would automatically generate the info based on the author entry, so it would be there. It may not generate as an active link yet, but it's a step toward it and learning about it and making it more useful. I have a feeling that I may end up running an html insert in batch form on multiple books if I want to get active links in a book. I'm going to ask Kovil to modify the mass edit metadata to have a "Append Comments" in addition to the "Set Comments" currently there. This is is something added to individual metadata downloads options a few versions back. I'm thinking he could do this rather easily and just overlooked the thought. This would solve something I've been trying to do for awhile. In this manner, a link could be added to the comments which are then Polished into the books metadata jacket producing an active link. While not auto generated, this would work VERY well. Last edited by jecilop; 09-01-2014 at 05:44 PM. |
![]() |
![]() |
![]() |
Tags |
lookup, templates |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Author field | moomintroll | Calibre | 1 | 03-29-2014 05:03 PM |
[Solution] Kindle Paperwhite: Lastname_Firstname author, Series in author field | Katsunami | Library Management | 6 | 11-15-2013 11:45 AM |
Kindle Paperwhite: Lastname_Firstname author, Series in author field | Katsunami | Library Management | 0 | 09-10-2013 12:43 PM |
Author field update and author sort | derangedhermit | Calibre | 4 | 01-23-2013 04:10 AM |
Author field help | CraftingGrandma | Library Management | 11 | 09-09-2011 09:58 PM |