View Single Post
Old 02-14-2012, 09:31 AM   #1544
Junior Member
vainglorious began at the beginning.
Posts: 2
Karma: 10
Join Date: Feb 2012
Device: kindle
Originally Posted by vainglorious View Post
Apologies if this is a repeat but searching this thread for a particular request is pretty painful.

I have just started using the plugin and the customisation looks like it's going to be pretty fantastic. I have copied the example custom column config to create collections based on author unless there is a tag called Non-Fiction:

{tags:'contains($,"Non-Fiction","Non-Fiction", field("author"))'}

Is there a way to replace 'Non-Fiction' with a wildcard so the expression would read 'if there is any tag at all, use that for the collection, otherwise use the author name'?


EDIT: I have tried

{tags:'contains($,field("tag"),field("tag"), field("author"))'}

but although that correctly pulls in whatever the tag is called, it seems to lose the author name as the default...

EDIT: And things like

{tags:'contains($,.*,field("tag"), field("author"))'}

trying to use a wildcard as the first part of the test but it really doesn't like that!
In answer to my own question:

{tags:'ifempty($, field('author'))'}

does the job.
vainglorious is offline