![]() |
#1 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,493
Karma: 8065348
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Custom tooltips in the book list view
One can use templates to define "custom tooltips" for columns in the book list. The tooltip can contain whatever you want as long as it can be generated by a template. Tooltips interpret HTML so you can construct complex displays. One test I did was to include in the tooltip the note for the value where the note contained a picture.
If you change the tooltip for "title" then the changed tooltip is used in the cover grid as well. To define a column tooltip, right-click on the column header and choose "(Define|Edit) column tooltip ...". It is also available as a calibre action, which means it is in the All Actions menu, can be given a shortcut, and can be added to context menus, favorites, action chains, etc. You can include the text that would have been used for the tooltip. See the help text when you first create a column tooltip template: Quote:
|
|
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,493
Karma: 8065348
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
This feature has a small bug in calibre 8.10.0 where the first time one defines a custom tooltip for a column, calibre must be restarted to "see" it. Subsequence edits of the tooltip for that column don't require the restart. The fix is in calibre source and will be in the next release/preview.
Here is a basic example of using a custom tooltip: presenting a list of genres in a more readable fashion. The standard tooltip looks like this. There are multiple genres per line with some of them broken across lines. If I use this template to generate the tooltip Code:
program: res = 'Genres:'; vals = list_sort($#genre, 0, ','); for t in vals: res = res & '<br>' & t rof; res And yes, the genres don't make a lot of sense. ![]() |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
want to learn what I want
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,662
Karma: 7908443
Join Date: Sep 2020
Device: none
|
I did a quick test with the Title column tooltip, in cover grid view.
It worked great with my Count Pages column {#pp} (default is #pages), thanks! |
![]() |
![]() |
![]() |
#4 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,493
Karma: 8065348
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
@Comfy.n: glad it works for you.
Another example: change the Series tooltip to show the number of books in the library with that series. Result: Template: Code:
program: if $series then series_count = book_count('series:"""=' & $series & '"""', 0); return $series & ', book ' & $series_index & ' of ' & series_count fi; return 'This book is not in a series' |
![]() |
![]() |
![]() |
#5 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 909
Karma: 810834
Join Date: Sep 2017
Location: Buenos Aires, Argentina
Device: moon+ reader, kindle paperwhite
|
very good idea!!
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,246
Karma: 1419583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
|
Cool! Now I can add other collaborators to my authors column.
|
![]() |
![]() |
![]() |
#7 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,246
Karma: 1419583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
|
Hi @chaley
Just noticed something weird with the HTML parser. I added the translator info to the authors' tooltip using this template: Code:
program: if $#translator then tooltip = 'Autor: ' & $authors & '<br/>' & 'Tradutor: ' & $#translator else tooltip = 'Autor: ' & $authors fi; tooltip Here it is without the <br/>: Now, with the <br/>: Last edited by thiago.eec; Today at 07:22 AM. |
![]() |
![]() |
![]() |
#8 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,493
Karma: 8065348
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
|
|
![]() |
![]() |
![]() |
#9 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,246
Karma: 1419583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
|
Quote:
P.S: I did this using Python Mode. I could not find a way to interpret the authors field as list in the regular Template Mode. What am I missing? |
|
![]() |
![]() |
![]() |
#10 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,493
Karma: 8065348
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Code:
program: res = 'Authors:'; for aut in "authors": res = res & '<br>' & aut rof; res Code:
program: res = 'Authors:'; for aut in $authors separator '&': res = res & '<br>' & aut rof; res |
|
![]() |
![]() |
![]() |
#11 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,246
Karma: 1419583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
|
Quote:
Code:
for aut in $authors: Thanks for your help! |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Book List View on front page | Amalthia | PocketBook | 5 | 01-01-2024 03:37 AM |
tooltips in the list of books | Fynjisx | Library Management | 1 | 11-23-2022 04:56 AM |
Delete Dates from Book List View | Rellwood | Calibre | 6 | 04-01-2022 02:19 PM |
Calibreserver issue using Book list mode/Custom list | fritskop | Server | 2 | 06-16-2020 01:20 PM |
View list of custom column settings? | BookJunkieLI | Calibre | 8 | 07-25-2014 09:36 AM |