View Single Post
Old 10-21-2011, 05:35 PM   #1
uli
Enthusiast
uli is at the top of the food chain.uli is at the top of the food chain.uli is at the top of the food chain.uli is at the top of the food chain.uli is at the top of the food chain.uli is at the top of the food chain.uli is at the top of the food chain.uli is at the top of the food chain.uli is at the top of the food chain.uli is at the top of the food chain.uli is at the top of the food chain.
 
Posts: 36
Karma: 114816
Join Date: Jun 2011
Location: Montreal
Device: Kobo, Calibre
Lightbulb Plugboard: Series Contains Star Wars formatting

I'd like the plugboard to use a different formatting when the series is Star Wars or Star Trek. So I created the following, everything works except if the title contains a comma or a parenthesis.

The calibre template guide mentions you need to escape these. How can I escape a field value?

Code:
{series:contains(Star Wars|Star Trek, {title}, {series}{series_index:0>2s| - | - }{title})}

Bad Solution:
Spoiler:

Created a custom column to escape the offending commas
Code:
#clean_title
{title:re(\,,\\,)}
Code:
{series:contains(Star Wars|Star Trek, {#clean_title}, {series}{series_index:0>2s| - | - }{#clean_title})}


The solution is to use program mode in the plugboard mentioned bellow.

Last edited by uli; 10-22-2011 at 01:52 PM. Reason: solution
uli is offline   Reply With Quote