Category Articles

patTemplating

Print

Form2Content Templates can use patTemplating syntax to create dynamic effects in the template. Conditional statements will be used most to show or hide layout depending on the value of a field. Using conditional statements will enable you to easily integrate plugins and css styling without having layout problems when someone hasn't filled out all the fields within a F2C Article.

Simple Conditional statement

If field has content show everything between the tags.


Field caption is not a variable yet:
{FIELDNAME}

Conditional statement for a Select Box

If condition is true, show Yes, if false (default), show No.


Yes
No

patTemplate Truncate function with conditional statement

There is a truncate function in patTemplate which allows you to cut the text of a variable (in our case a F2C Field) at a set length.




NOTE: There is one problem with this approach. If you use html tags in your content (i.e. use of an editor) these will also besplit so it is best to use a Text Area field without editor for your input.

Link: patTemplate Documentation
Royalty Free Images
Verschillende betaalmethoden

Open Source Design

Ceresstraat 24
4811CC Breda
The Netherlands
+31(0)765152174