View Single Post
Old 12-12-2021, 06:11 AM   #218
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,475
Karma: 8025702
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
That fixed books with slashes. However, now there's no icons for books that are #currentlyreading but don't have a slash:
Any idea what's going on?
Yes. There is no 'else' on
Code:
if $#fanficcat && '/' in $#chapters then
so the template produces no output in that case. You need something like this:
Code:
		if $#fanficcat && '/' in $#chapters then
			f = re($#chapters, '(.*)/.*', '\1');
			s = re($#chapters, '.*/(.*)', '\1');
			if (s - f) ==# 1 then
				'add_book.png' 
			else		
				'bookmark-48.png'
			fi
		else		
			'exploding-book.png'
		fi
When coding a template you should verify the various code paths created by if/then/else to be sure that each path possibility results in what you want based on what you know about the data.
chaley is offline   Reply With Quote