A different question:
I have this for a column.
Code:
program:
first_non_empty(
if 'Cleanup' in virtual_libraries() then 'polish.png' fi,
if 'Fanfiction' in $#booktype then icons_fanfic() 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,
'view.png',
)
icons_fanfic() is a strcat that looks like this so that I get multiple icons:
Code:
program:
f = $#fanficcat;
strcat(
if "^Fallout$" inlist f then 'fallout.png:' fi,
if "^Half-Life$" inlist f then 'halflife.png:' fi,
if "^(Mass Effect Trilogy|Mass Effect: Andromeda)$" inlist f then 'masseffect.png:' fi,
if "^The Elder Scrolls$" inlist f then 'theelderscrolls.png:' fi,
if "^Pokémon$" inlist f then 'pokemon.png:' fi,
if "^Portal$" inlist f then 'portal.png:' fi,
)
In the first template, I'd like to display only the first icon in order to match the others.
If it's possible, it seems the easiest way to do this would be to truncate at the first colon so the output is, e.g.
fallout.png instead of
fallout.png:halflife.png:. Is this doable?
EDIT: list_split is what i was looking for!
Code:
if 'Fanfiction' in $#booktype then
list_split(icons_fanfic(), ':', 'ff');
ff_0 fi,