Thanks.
I converted one of my templates to get a better idea of how the switch_if works. Is this a good place to use one?
Code:
program:
switch_if(
'Cleanup' in virtual_libraries(), 'polish.png',
'Fanfiction' in $#booktype, list_split(icons_fanfic(), ':', 'ff');
ff_0,
'Documentations & Manuals' in $#booktype, 'helpbook.png',
'Loans' in virtual_libraries(), 'overdrive.png',
'Physical Books' in virtual_libraries(), 'paperbook.png',
approximate_formats()=='PDF', 'pdfbook.png',
'omnibus' inlist $#admintags, 'bookshelf.png',
'book_open.png',
)
original first_non_empty template:
Spoiler:
Code:
program:
first_non_empty(
if 'Cleanup' in virtual_libraries() then 'polish.png' fi,
if 'Fanfiction' in $#booktype then
list_split(icons_fanfic(), ':', 'ff');
ff_0 fi,
if 'Documentations & Manuals' in $#booktype then 'helpbook.png' fi,
if 'Loans' in virtual_libraries() then 'overdrive.png' fi,
if 'Physical Books' in virtual_libraries() then 'paperbook.png' fi,
if approximate_formats()=='PDF' then 'pdfbook.png' fi,
if 'omnibus' inlist $#admintags then 'bookshelf.png' fi,
'book_open.png',
)
(at times like this, sometimes I wish there was some sort of split template editor so I could compare the results of two templates. That's probably not too useful generally though.)