Hello,
I want to differentiate actions depending on the title format type of the selected books. There are lots of different actions depending on this formats. The format types change quite often.
So I want to test the title format only once at the beginning, storing the result with set_book_vars('otyp', "Title Format Type") and then setting conditions on this book var.
This does not work for me and I fear I did not understand the concept of the book vars ...
I create a "Test" chain:
1st Action: "Chain Variable" OYTP with template
Code:
program:
otyp = switch(field('title'),
".*\s+\(\d\d\.\d\d\.\d\d\d\d\)\s*", "Zeitung",
".*\s+\(\d\d/\d\d\d\d\)\s*", "Zeitschrift",
"Unbekannt");
set_book_vars('otyp',otyp);
book_vars('otyp')
2nd Action: "Single Field Edit" "#feltes1" → template
Code:
program:
book_vars('otyp');
with condition compared as text = Zeitschrift
Code:
program:
book_vars('otyp');
3rd Action: "Single Field Edit" "#feltes2" → template
Code:
program:
book_vars('otyp');
Fortunately the book variable "otyp" is set correctly, "#feltes2" shows the correct values, everytime.
Unfortunately the condition for "#feltes1" only works as expected if only one book is selected ...
You may find the chain export attached ...
P.S. Puha, that plugin definitely is more capable then my template skills