Quote:
Originally Posted by Wiggo
thx obc, already implemented.
@chaley: I see an icon if I have only one format or source. But as soon as I have two entries, no icon for format/source appears at all anymore.
|
It works for me. I did make a change to the add_icon() function to avoid empty icon names, but it works without that change.
Here is the booklist:

The icons are on the author column.
Here is the cc_icons folder:
Here is the icon rule screen:
And here is the template, which is the same as yours except the one change mentioned above and changing the 'uk.png' icon name to 'beautify.png':
Code:
program:
def add_icon(icon, val):
if ! val then return icon fi;
if icon == '' then icon = val else icon = icon & ':' & val fi;
return icon
fed;
icon = '';
if $languages == 'eng' then icon = add_icon(icon, 'beautify.png') fi;
icon = add_icon(
icon,
switch(
$$#toread,
'true', 'toread.png',
'false', 'false.png',
''));
if $$#formats == 'paper' then icon = add_icon(icon, 'paper.png') fi;
if $$#read == 'true' then icon = add_icon(icon, 'ok.png') fi;
if $$#source == 'geniallokal' then icon = add_icon(icon, 'geniallokal.png') fi;
if $$#source == 'wbg' then icon = add_icon(icon, 'wbg.png') fi;
if $$#readinglist != '' then icon = add_icon(icon, 'reading_list.png') fi;
if $$#annots != 'NONE' then icon = add_icon(icon, 'annotations.png') fi;
if list_count($authors, '&') > 1 then icon = add_icon(icon, 'series_authors.png') fi;
return icon
One possibility: you can't use == for multi-value columns. If #formats or #source is tags-like then you must use 'inlist'. as this:
Code:
if 'paper' inlist $#formats then icon = add_icon(icon, 'paper.png') fi;