View Single Post
Old 09-26-2011, 03:21 AM   #3
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,476
Karma: 8025702
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Using {tags} in a template will get *all* the tags, not test for existence of a particular tag.

Starting a "more than you wanted to know" section....

The easiest thing to do is to create a custom text column (not tags-like) and enter the folder name in that. Then use {#column_name} in the template.

You can avoid the extra column by using a template program to check if a tag is there and return the folder name you wish to use. This is rather complicated. The construct would be something like
Code:
{tags:'first_non_empty(
    in_list($, ',', '^news$', 'news_folder', ''), 
    in_list($, ',', '^foo$', 'foo_folder', ''),
    in_list($, ',', '^bar$', 'bar_folder', ''))'}
You can simplify the above if you don't care about submatches, meaning you don't have tags of the form "my_news" or don't care if you get both "news" and "my_news" when checking for the tag "news".
chaley is offline   Reply With Quote