View Single Post
Old 02-05-2023, 10:17 AM   #11
Wiggo
Leftutti
Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.
 
Wiggo's Avatar
 
Posts: 549
Karma: 1717097
Join Date: Feb 2019
Location: Bavaria
Device: iPad Pro, Kobo Libra 2
I have an #annots column 'Long text, like comments, not in tag browser' for annotations and I want - like above - an icon if there are annoations.

Code:
program:
	def add_icon(icon, val):
		if icon == '' then icon = val else icon = icon & ':' & val fi;
		return icon
	fed;

	icon = '';
	if $languages == 'eng' then icon = add_icon(icon, 'uk.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 $$#readinglist != '' then icon = add_icon(icon, 'reading_list.png') fi;
	if $$#annots != '' then icon = add_icon(icon, 'annotations.png') fi;
	return icon
With this code I get the icon on every book.

I also tried
Code:
	if $$#annots == 'true' then icon = add_icon(icon, 'annotations.png') fi;
I don't get any annot icon

Some help much appreciated
Wiggo is offline   Reply With Quote