View Single Post
Old 01-06-2014, 01:33 AM   #428
ACGAuthor
Enthusiast
ACGAuthor began at the beginning.
 
Posts: 41
Karma: 10
Join Date: Nov 2013
Device: Kindle PW
Quote:
Originally Posted by eschwartz View Post
For that list alone, the following would work:
Code:
{tags:switch(Dragons,SFF/UF/PNR,Dwarves,SFF/UF/PNR,dystopian,SFF/UF/PNR,elves,SFF/UF/PNR,faeries,SFF/UF/PNR,Fairy Tales,SFF/UF/PNR,Fantasy,SFF/UF/PNR,Fantasy & Magic,SFF/UF/PNR,futuristic,SFF/UF/PNR,Gods,SFF/UF/PNR,Hard Science Fiction,SFF/UF/PNR,Hobbits,SFF/UF/PNR,Horror,SFF/UF/PNR,Horror Tales,SFF/UF/PNR,magic,SFF/UF/PNR,Magic & Wizards,SFF/UF/PNR,orcs,SFF/UF/PNR,paranormal,SFF/UF/PNR,psychic ability,SFF/UF/PNR,Science Fiction,SFF/UF/PNR,Sci Fi,SFF/UF/PNR,sci-fi,SFF/UF/PNR,Science Fiction & Fantasy,SFF/UF/PNR,shifters,SFF/UF/PNR,Space Opera,SFF/UF/PNR,Star Trek,SFF/UF/PNR,Urban Fantasy,SFF/UF/PNR,Vampires,SFF/UF/PNR,Witches & Wizards,SFF/UF/PNR,zombies,SFF/UF/PNR,)}
Obviously, we will need to fill in more pattern,value pairs for the rest.

If tag exists, #collection will be equal to "SFF/UF/PNR", if not, the last field is blank (see how it ends in a "," and nothingness follows the ","?) so no value will be used from this template chunk. Note also that it will be satisfied with finding the first tag, if there are multiple matching tags ONLY the first one in the switch() list will be used.
Okay, that worked. I do definitely need to do some tag wrangling to make this as effective as possible, but I suppose that is unavoidable. It's ridiculous the amount of housekeeping that goes into adding books to the library, lol.
ACGAuthor is offline   Reply With Quote