View Single Post
Old 09-26-2019, 12:00 PM   #9
Horus68
Zealot
Horus68 understands the mechanisms of the catecholamine pathways.Horus68 understands the mechanisms of the catecholamine pathways.Horus68 understands the mechanisms of the catecholamine pathways.Horus68 understands the mechanisms of the catecholamine pathways.Horus68 understands the mechanisms of the catecholamine pathways.Horus68 understands the mechanisms of the catecholamine pathways.Horus68 understands the mechanisms of the catecholamine pathways.Horus68 understands the mechanisms of the catecholamine pathways.Horus68 understands the mechanisms of the catecholamine pathways.Horus68 understands the mechanisms of the catecholamine pathways.Horus68 understands the mechanisms of the catecholamine pathways.
 
Horus68's Avatar
 
Posts: 143
Karma: 76596
Join Date: Feb 2015
Location: Portugal
Device: Kobo Aura HD
I'm not an English user so something was lost in translation.
See attached print screens!

I want to sort series the proper way when saving to disk.
In Save to disk I used
Code:
{series_index:0>2s| - |}
taken from here... https://manual.calibre-ebook.com/template_lang.html

It works fine and the output is a proper two digits with trailing zeros
Code:
- 02 -
BUT... when using that code in my template it doesn't allow to save the code as there is a parsing error when hitting the button APPLY (the template editor do not shows any error)

This code can be saved in Calibre "Save to disk" template
Code:
{author_sort:sublist(0,1,&)}/{author_sort:sublist(0,1,&)}{title:.60| - |}/{author_sort:sublist(0,1,&)}{series:.25| - |}{series_index:| - |}{title:.55| - |}
BUT this code (with trailing zeros for series) cannot be saved in Calibre "Save to disk" template

Code:
{author_sort:sublist(0,1,&)}/{author_sort:sublist(0,1,&)}{title:.60| - |}/{author_sort:sublist(0,1,&)}{series:.25| - |}{series_index:0>2s| - |}{title:.55| - |}
In the editor popup it works fine but in the main window, the apply button fires an error:
The error says something like "The template contains no {fields}"

So I know that something is wrong... only I don't know what!
Note: Using Calibre 3.48.0 windows x86
Attached Thumbnails
Click image for larger version

Name:	editor_no_trailingzeros_working_en.png
Views:	224
Size:	43.5 KB
ID:	173731   Click image for larger version

Name:	editor_trailingzeros_editor_working_en.png
Views:	177
Size:	13.6 KB
ID:	173732   Click image for larger version

Name:	template_trailingzeros_not saving_en.png
Views:	420
Size:	67.6 KB
ID:	173733  

Last edited by Horus68; 09-26-2019 at 12:14 PM.
Horus68 is offline   Reply With Quote