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 09-01-2014, 07:24 AM   #1
jecilop
Addict
jecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day now
 
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've tried {links} and ({link} since that's what the field names appears as, but nothing is returned when I definitely have something entered there.
  • I've also tried {author_link} and {author_links} with no return.

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
jecilop is offline   Reply With Quote
Old 09-01-2014, 11:30 AM   #2
BookJunkieLI
Evangelist
BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.
 
BookJunkieLI's Avatar
 
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.
BookJunkieLI is offline   Reply With Quote
Advert
Old 09-01-2014, 11:51 AM   #3
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by BookJunkieLI View Post
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.
Book jackets do not use the full template language, so you cannot use formatter functions. You are limited to the fields that are directly supported in jackets, which as far as I can tell from looking at the code are title_str, title, author, publisher, pubdate_label, pubdate, series_label, series, rating_label, rating, tags_label, tags, comments, and custom columns.
chaley is offline   Reply With Quote
Old 09-01-2014, 12:29 PM   #4
BookJunkieLI
Evangelist
BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.
 
BookJunkieLI's Avatar
 
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:
You would use this new function in a composite column (col built from other cols).
But now you're saying you can't? Aren't composite columns made up of templates? Or is this a case of me confusing terms?
BookJunkieLI is offline   Reply With Quote
Old 09-01-2014, 12:41 PM   #5
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by BookJunkieLI View Post
Okay, I'm really confused now. In the referenced post you said,
But now you're saying you can't? Aren't composite columns made up of templates? Or is this a case of me confusing terms?
A composite column is in the end a custom column. Its template is evaluated when metadata is saved for whatever purpose, from showing in the GUI through sending to device to building jackets. So yes, you can use a composite column in a jacket.

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.
chaley is offline   Reply With Quote
Advert
Old 09-01-2014, 01:16 PM   #6
BookJunkieLI
Evangelist
BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.BookJunkieLI ought to be getting tired of karma fortunes by now.
 
BookJunkieLI's Avatar
 
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?
BookJunkieLI is offline   Reply With Quote
Old 09-01-2014, 02:06 PM   #7
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by BookJunkieLI View Post
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?
Not quite ...

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.
chaley is offline   Reply With Quote
Old 09-01-2014, 05:30 PM   #8
jecilop
Addict
jecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day now
 
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.
jecilop is offline   Reply With Quote
Reply

Tags
lookup, templates


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 08:46 AM.


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