26 Oct 2023 (in calibre beta 6.99)
New template functions for notes:
- get_note()
Code:
get_note(field_name, field_value, plain_text)
Fetch the note for field 'field_name' with value 'field_value'. If 'plain_text' is empty, return the note's HTML. If 'plain_text' is non-empty, return the note's plain text. If the note doesn't exist, return '' in both cases.
Example: get_note('tags', 'Fiction', '') returns the HTML of the note attached to the tag 'Fiction'.
- has_note()
Code:
has_note(field_name, field_value)
Return '1' if the value 'field_value' in the field 'field_name' has an attached note, otherwise return ''.
Example: has_note('tags', 'Fiction') returns '1' if the tag 'fiction' has an attached note, otherwise return ''.