View Single Post
Old 10-10-2011, 12:00 PM   #4
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,741
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Noughty View Post
I have fixed values. I might only need to add new ones once in awhile. It's possible to add additional ones?
The strings 'val1, val2' etc are the list of values you want to consider. You can change these easily by editing the template. The easiest way to edit a template is to click anywhere in the composite column and press F2, which opens the template editor
Quote:
#textmulti is a function? No need to change that?
That is the lookup name of one of your columns. You would put a different lookup name in each list_intersection call. I used #testmult because that was a tags-like column i had available.
Quote:
So I have to fill in values and columns (tags, #shelf).
Yes
Quote:
val1, val2 - I should write - historical, fantasy etc?
I assumed that the two columns contain different values and would therefore have a different list of valid values. One of the strings could be the list of valid genres, and it would in the list_intersection call with the #genres field. The other could be shelf names, and would be associated with the #shelves variable. If you have a third one, then the program would need to be extended. Exactly how will depend on what you are trying to do and the characteristics of your data -- how contents overlap (if at all) and what is supposed to happen when the same values are found in more than one column.
Quote:
Where should I write the columns: tags and #shelf ?
In the field function inside the list_intersection function.
Quote:
I should copy program into template?
Or write the one that does what you want.

I suggest that you read the documentation for the functions I used (docs are at http://manual.calibre-ebook.com/template_ref.html). That might help you understand what the template program is doing.
chaley is offline   Reply With Quote