View Single Post
Old 01-15-2021, 02:45 AM   #1
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 11,095
Karma: 76037135
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Template: avoid multiple images?

Quote:
Originally Posted by ownedbycats View Post
Question: I'm converting my fanfic column icon rules to a single advanced rule.

Code:
program: 
   f = field('#fanficcat');
   strcat
   (
    contains(f, "Dragon Age: Origins", 'dragonageorigins.png', ''), 
    contains(f, "Half-Life", 'halflife.png', ''), 
    contains(f, "Mass Effect", 'masseffect.png', ''), 
    contains(f, "The Elder Scrolls", 'theelderscrolls.png', ''), 
    contains(f, "Pokémon", 'pokemon.png', ''), 
    contains(f, "Portal", 'portal.png', ''), 
   )
It works except for when there's multiple values (#fanficcat is a tag-like). Clicking on one of the crossovers in the book list and opening the template editor shows "masseffect.pngpokemon.png".

What should I do?
Another question regarding this one:

Code:
 strcat
   (
    contains(f, "foo", 'foobar.png:', ''), 
    contains(f, "bar", 'foobar.png:', ''),  
   )
If a book has both "foo" and "bar", how do I get it to display foobar.png only once without using first_non_empty?

ownedbycats is offline   Reply With Quote