Thread: Custom Coloring
View Single Post
Old 05-29-2011, 09:17 AM   #16
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,486
Karma: 8025704
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by kovidgoyal View Post
{tags:'test($, "red", "black")'}
Actually, I think you want
Code:
{tags:'test($, "black", "red")'}
if you want the field to be red when there are no tags.

The test function returns the first string (the second argument) if the value (the first argument) is not empty, otherwise it returns the second string.

In this case, the value being tested is tags. My understanding is that you want to return 'black' if tags is not empty, otherwise 'red'.
chaley is offline   Reply With Quote