Last modified: July 26, 2020

Templates

Template Engine was added since version 3.0 of EasyAppointments. First it is available for Events overview at FullCalendar short code.

Add variables to content

It is simple to add variables to content:

{= varName}

Example:

Location: {= event.location_name}

To get all values that are possible just add this to template:

// All fields
{= __CONTEXT__ | raw}

IF / Else statements

You can add IF or IF – ELSE statements like this:

{if someVarName == "SomeValue"}
Hello World
{/if}
{if someVarName == "SomeValue"}
Hello World
{else}
Goodbye World
{/if}

Comments

Use {# #} to add comments (will be stripped from output) :

Template {# Some Comment #}
{# Some
Multiline
Comment #}

Loops

You can insert loops:

{for curName in names}
Current Name: {= curName}
{/for}

Inside each loop, there are to magick-values @index0 (index starting with 0) and @index1 for a index starting with amp1.

{for curName in names}
Line {= @index1 }: {= curName}
{/for}

Inside loops you can {break} or {continue} the loop.

Full documentation

Link to full documentation : https://github.com/dermatthes/text-template