![]() |
#106 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 146
Karma: 2594
Join Date: May 2009
Device: Kindle PW,Sony 700, Sony 950 (Daily Edition),Nook Color,iPad
|
ah.. fantastic, that is where I thought but wanted to be sure, you have made my day...
|
![]() |
![]() |
![]() |
#107 |
Junior Member
![]() Posts: 9
Karma: 10
Join Date: Dec 2010
Device: Kindle 3
|
This plugboard feature is very nice. The only problem I have found is that when emailing my Kindle the name is unchanged. It only will do it if you transfer via USB.
Is there any way to enable this for both conversions? |
![]() |
![]() |
Advert | |
|
![]() |
#108 |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Jan 2011
Device: Kindle 3
|
![]()
I am officially going insane. I know I'm missing something simple, but after reading this forum and the online manual I cannot for the life of me figure out what I'm doing wrong.
I have a custom column named Genre. The lookup/search name is "#genre". In both the plugin and the sending books to devices I have it set as Code:
{#genre}/{authors} - {series_index}.{series} - {title} I've stayed up much too late trying to figure this out, so I'm headed to bed, but any help you can give would be much appreciated in the morning. Goodnight. Last edited by ibigfire; 01-03-2011 at 08:48 PM. |
![]() |
![]() |
![]() |
#109 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
What version of calibre are you running? Custom columns have been around longer than they were supported in templates. I don't remember the version where template support came in, but I think it was around 0.7.20.
|
![]() |
![]() |
![]() |
#110 |
Junior Member
![]() Posts: 8
Karma: 10
Join Date: Nov 2010
Device: Kindle
|
Many thanks to all who have lead the way on this - I thought I would add my two-pennyworth and findings.
My problem was the normal kindle/series/collection title format problem but I wasnt happy that any one derived format fixed the problem as I could see having collections with one series where just the series number would be ok and others with more than one where I would want to show the series name or a shortened version of this as well. To implement this flexible solution I created 3 custom columns:- 1) A format picker allowing me to decide which style I want for the particular book. I ended up with a) Full Series name and series no + title b) Alt series name (see 2) + number + title c) Shortened series name as per earlier examples + no + title d) Series No only + title e) title only column lookup name = kindle_title_fmt column type = Text with fixed list of values values = Series and Num,Alt and Num,Short and Num,Num only,No Series info 2) A column for an alternative series name if the shortened or full didnt suit column lookup name = alt_series_name column type = text 3) An output column showing the final book name as it will appear in the kindle and it is this one that contains all the code. column lookup name = kindle_title column type = column built from other columns column code:- Code:
program: stripped = re(field('series'), '^(A|The|An)\s+', ''); shortened = shorten(stripped, 4, '-' ,4); initials = re(stripped, '[^\w]*(\w?)[^\s]+(\s|$)', '\1'); s_index = template('{series_index:0>2.0f}'); abrv=strcat( switch( stripped, '.\s', initials, '.', shortened, field('series')), test(s_index, strcat(' ', s_index, ': '), ''), field('title')); str_title1 = template('{series}{series_index:0>2.0f| |: }{title}'); str_title2 = template('{#alt_series_name}{series_index:0>2.0f| |: }{title}'); str_title3 = abrv; str_title4 = template('{series_index:0>2.0f| |: }{title}'); str_title5 = template('{title}'); str_default = str_title5; str_input = lowercase(field('#kindle_title_fmt')); switch(str_input, 'series and num',str_title1, 'alt and num',str_title2, 'short and num',str_title3, 'num only',str_title4, 'no series info',str_title5, str_default); Personally I would also recomend changing the filename fmt in the kindle 2 plugin to include the series to make it easier if you are using the kindle collection manager You can change the default simply by re-pointing str_default at one of the other title fmts Learning notes:- 1) It wasnt immediately obvious to me despite being reasonably documented that you reference custom columns by sticking a '#' on the front of the name. Probably because none of the code examples showed it and I hate reading words as opposed to example code. 2) the switch command is incorrectly documented (missing the switch field) - I have raised a bug for this. 3) Was easiest to just put any old text into the 3rd column when creating it then use the f2 edit later to put the actual code in. People should be able to easily modify the above to produce their own flexible solutions and it also neatly shows how to use custom columns - hope this helps someone rgds Stephen Note this is my first attempt at the calibre mods/programming and I am sure someone will come up with a better cleaner solution. The code could certainly be better. Serious props to those that created and maintain calibre ![]() |
![]() |
![]() |
Advert | |
|
![]() |
#111 |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Jan 2011
Device: Kindle 3
|
0.7.37
At some point last night I figured there might be a bug so I updated. It didn't help unfortunately. Just to confirm I'm doing things right, I've attached a picture of what I think is all the pertinent information. Also, very impressive job, stevehaley. |
![]() |
![]() |
![]() |
#112 | |
Junior Member
![]() Posts: 8
Karma: 10
Join Date: Nov 2010
Device: Kindle
|
Quote:
is it '#genre#' or 'genre' (ignore quotes) - it should be the latter. You add the # elsewhere at the start to reference the field as it is custom. ie elsewhere it will always be {#genre} also I suspect it is all case sensitive - you have {#Genre} there not {#genre} I think ..... |
|
![]() |
![]() |
![]() |
#113 | |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Jan 2011
Device: Kindle 3
|
Quote:
I tried both the lowercase {genre} and the uppercase, but due to it remembering that I tried uppercase it won't stop automatically filling it in as uppercase because it remembers it as a previous template. Even if I forcefully get it to be a lowercase 'g' when I hit Apply and go back into it to check it, it's turned itself uppercase again. Super annoying, but I figure the plugin settings override the general preferences settings anyways, I think, so it shouldn't be stopping it from working. |
|
![]() |
![]() |
![]() |
#114 | |
Junior Member
![]() Posts: 8
Karma: 10
Join Date: Nov 2010
Device: Kindle
|
Quote:
|
|
![]() |
![]() |
![]() |
#115 |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Jan 2011
Device: Kindle 3
|
We think alike, apparently. I tried changing it to "type" at one point. It really seems like it should be working...
|
![]() |
![]() |
![]() |
#116 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Thanks for sharing this.
A note on your notes: Quote:
Also, I found a problem yesterday with general program mode composite columns used in plugboards/templates. The program itself was substituted, not the evaluation of the program. Have you verified that your plugboard {#kindle_title} puts the values you expect into the book? I fixed the problem. It will be available in the next release. A workaround is to use general program mode in the plugboard, in your case program:field(#isbn) |
|
![]() |
![]() |
![]() |
#117 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
1) The column heading can be whatever you want. 2) The lookup name must be lower case. You prefix this name with a '#' to use the column. In your case, #genre. 3) I agree, the history can get annoying. I will look at fixing this by making the completion case sensitive. In this case, work around it by putting an extra space before the first slash. Calibre will remove that extra space later. Your assumption is correct: the plugin value takes precedence over the general one. |
|
![]() |
![]() |
![]() |
#118 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Workaround: (removed. It doesn't work. ![]() Last edited by chaley; 01-04-2011 at 06:21 AM. Reason: remove workaround |
|
![]() |
![]() |
![]() |
#119 | |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Jan 2011
Device: Kindle 3
|
![]() Quote:
The workaround doesn't seem to work; it still makes a folder named #genre and puts all the books into it, but it's definitely referencing the Genre column correctly, because it put all the info from Genre into it's own column (named Type) properly, and it's naming the folder on my Kindle #genre, not #type, even though I made sure that {#type} is both in the general preferences spot and the plugin preferences spot. But I'm not worried, if doing it the proper way will work within a few weeks or sooner than that's good enough for me. The organization will be nice for the future but I can still find and read specific books for now just fine so I'm in no rush. Thank you so much Chaley, you're friggin' awesome! I also really appreciate your aide too, stevehaley, both of you are great. |
|
![]() |
![]() |
![]() |
#120 | |||
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
![]() ![]() Quote:
![]() Quote:
|
|||
![]() |
![]() |
![]() |
Tags |
custom column, tag, tags |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
custom column i need a little help | shinken | Calibre | 3 | 09-15-2010 03:41 AM |
Using Custom Metadata in Save Template | EJvdH | Calibre | 1 | 07-02-2010 06:06 AM |
Accessories Decalgirl Kindle 2 custom skin template | srmalloy | Amazon Kindle | 6 | 04-09-2010 09:55 PM |
Donations for Custom Recipes | ddavtian | Calibre | 5 | 01-23-2010 04:54 PM |
Help understanding custom recipes | andersent | Calibre | 0 | 12-17-2009 02:37 PM |