Quote:
Originally Posted by Comfy.n
|
Assuming you use a composite column (column built from other columns) that behaves like tags, they are clickable without using the PI. Are you seeing something different?
And just for fun I made a composite column that lets you switch VLs by clicking the links in book details. The GPM template is:
Code:
program:
res = '';
for vl in virtual_libraries():
if res then res = res & '<br>' fi;
res = res & '<a href="calibre://search/_?encoded_virtual_library=' & to_hex(vl) & '">' & vl & '</a>'
rof;
res
The column definition is:
What you see is:
And for more fun, here is the template using python template mode (PTM), which will be much faster than the GPM template above:
Code:
python:
def evaluate(book, ctx):
db = ctx.db.new_api
return ('<br>'.join(
[f'<a href="calibre://search/_?encoded_virtual_library={vl.encode().hex()}">{vl}</a>'
for vl in db.virtual_libraries_for_books((book.id,))[book.id]
]))
EDIT: corrections to the column setup and the python template