View Single Post
Old 07-16-2014, 07:00 AM   #1
fxp33
Addict
fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.
 
Posts: 262
Karma: 110864
Join Date: Mar 2013
Location: Bordeaux, France
Device: Kobo Glo, Aura HD, kindle paperwhite
[solved] template: if one of the tag is sthg... maybe contains or in_list functions

Hi all,

Post Summary
Can someone provide a way to display a word in the filename depending on the presence of the tags? Something like :

If one of the tags is "xxx" then add "yyy" if not "zzz"

Detailed post

I am testing the way my books are rendered on my reader.
I need the template to add a special keyword in the filename (actually an extension prefix) when sending to device, depending on the tags I gave:

If one the tags is "kepub" display ".kepub" if not display ""

I didn't succeed with these syntaxes:
  • {tags:contains("kepub",".kepub","")}
  • {tags:in_list(",","kepub","kepub",".kepub")}
  • Notice that there is a syntax with 5 arguments (for the built-in templates) in the template engine. So I tried also: in_list({tags},",","kepub",".kepub","")

Can someone provide examples for those functions using the {tags} as value:
  • in_list(separator, pattern, found_val, not_found_val) Reference
  • contains(pattern, text if match, text if not match) Reference


Resources:
Thank you for your help,

Regards

François

Last edited by fxp33; 07-19-2014 at 05:20 AM. Reason: marked solved
fxp33 is offline   Reply With Quote