This page delves into details related to template-based thumbnails. Look here for more general information on templates.
What is a conditional formatting?Conditional formatting is a way to format html content based on the value of some expression. Unlike conditional content, conditional formatting is not meant to allow or block content, but conditional content and conditional formatting are expressed in much the same way. In order to use conditions, a special keyword must be used,
A simple scenarioWe are going to change the background color of a shot. The rule is : every even shot background color should be the same than the whole page background color (grey), otherwise it should be white. Here is how this gets expressed in a template : <body bgcolor="#EEEEEE"> <center> <h1>$(TITLE)</h1> <table border="0"> <tr> <td $(IF, condition="$(INDEX) % 2")bgcolor=#FFFFFF$(ENDIF)>$(BEGINSHOT) <img src= "$(SHOTFILENAME)"><br><center>$(SHOTCAPTION)</center>$(ENDSHOT)</td> <td $(IF, condition="$(INDEX) % 2")bgcolor=#FFFFFF$(ENDIF)>$(BEGINSHOT) <img src= "$(SHOTFILENAME)"><br><center>$(SHOTCAPTION)</center>$(ENDSHOT)</td> <td $(IF, condition="$(INDEX) % 2")bgcolor=#FFFFFF$(ENDIF)>$(BEGINSHOT) <img src= "$(SHOTFILENAME)"><br><center>$(SHOTCAPTION)</center>$(ENDSHOT)</td> </tr> <tr> <td $(IF, condition="$(INDEX) % 2")bgcolor=#FFFFFF$(ENDIF)>$(BEGINSHOT) <img src= "$(SHOTFILENAME)"><br><center>$(SHOTCAPTION)</center>$(ENDSHOT)</td> <td $(IF, condition="$(INDEX) % 2")bgcolor=#FFFFFF$(ENDIF)>$(BEGINSHOT) <img src= "$(SHOTFILENAME)"><br><center>$(SHOTCAPTION)</center>$(ENDSHOT)</td> <td $(IF, condition="$(INDEX) % 2")bgcolor=#FFFFFF$(ENDIF)>$(BEGINSHOT) <img src= "$(SHOTFILENAME)"><br><center>$(SHOTCAPTION)</center>$(ENDSHOT)</td> </tr> <tr> <td $(IF, condition="$(INDEX) % 2")bgcolor=#FFFFFF$(ENDIF)>$(BEGINSHOT) <img src= "$(SHOTFILENAME)"><br><center>$(SHOTCAPTION)</center>$(ENDSHOT)</td> <td $(IF, condition="$(INDEX) % 2")bgcolor=#FFFFFF$(ENDIF)>$(BEGINSHOT) <img src= "$(SHOTFILENAME)"><br><center>$(SHOTCAPTION)</center>$(ENDSHOT)</td> <td $(IF, condition="$(INDEX) % 2")bgcolor=#FFFFFF$(ENDIF)>$(BEGINSHOT) <img src= "$(SHOTFILENAME)"><br><center>$(SHOTCAPTION)</center>$(ENDSHOT)</td> </tr> </table> <center> </body> And it produces the following : ![]() The table above is made of 9 cells enclosed by
Regarding expressions, the following operators are available :
And of course, all keywords are available, as well numerical and string litterals.
Other scenariosIt's just as easy to switch the shot caption to bold for instance. The following condition turns the 3rd shot to bold : $(IF, condition="$(INDEX) = 3")<b>$(ENDIF) $(SHOTCAPTION)$(IF, condition="$(INDEX) = 3")</b>$(ENDIF) And it produces the following : ![]() To virtually all styles you can manipulate with standard html tags, you can add expressions to control how they behave throughout the thumbnail generation.
|