View Single Post
Old 04-11-2021, 07:54 AM   #511
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,465
Karma: 8025600
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
@capink: what do you think about a template function
Code:
is_book_var_defined('var_name')
that returns '1' or ''.

The function would get around the ambiguity between a defined book_var that contains '' and an undefined book_var. Something like this:
Code:
	if is_book_var_defined('foo') then
		result = book_vars('foo')
	else
		result = field('whatever')
	fi;
	result
chaley is offline   Reply With Quote