Advanced Template Editor Functions

Template Coding Variables

Variables are what make the document generator in SILQ powerful.

They allow you to access almost any data in the database in the way that you want and format the data to look how you want.

Variables that are resolved when you generate the Document are enclosed in angle brackets. Ie < and >.

For example:

  •  the variable <i:today> will be resolved as today’s date;
  •  the variable <i:s-bn> will be resolved as the SILQ user’s name.

The below explains the different types of variables in more detail. You can find some common variable formats in the article called Template Coding Variable Formats

Variable Types

There are a number of different variable types that act differently within a template. These are specified as the first component of a field to tell SILQ what to do.

I: Insert value 

This will insert a value from the database. It requires that the field to be inserted must be specified as the second parameter.

E: Remove line if field is empty 

This will remove the paragraph if the field is empty. A field is considered "empty" if it is blank or has the value "No" or has a zero value. If it is in a table it will remove the row. varformattype and varformatextra are ignored.

N: Remove line if field is not empty 

This will remove the paragraph if the value is not empty. A field is considered "empty" if it is blank or has the value "No" or has a zero value. If it is in a table it will remove the row. varformattype and varformatextra are ignored.

PE: Remove paragraph if field is empty 

This will remove the paragraph if the value is empty. If it is in a table it will still only remove the paragraph and not the row.
varformattype and varformatextra are ignored

PN: Remove paragraph if field not empty 

This will remove the paragraph if the value is not empty. If it is in a table it will still only remove the paragraph and not the row.
varformattype and varformatextra are ignored

Multi: Generate Multiple rows 

This will make the system generate multiple rows of data of the type that is specified. There are many multi fields that will iterate through a particular database and allow you to generate tables of information.
varformattype and varformatextra are ignored

Examples
<i:i-date> 
Will insert a the i-date field

Ref: <i:m-ref><e:m-ref> This will put the literal text "Ref:" at the start of the line, then insert the m-ref field for the first field, but if the m-ref is empty it will remove the entire line so only end up with a reference line if there is a reference.

<i:i-id> <i:i-date> <i:i-pay> <i:i-recint> <i:i-out> <e:i-out> <multi:invoice> 

This is an advanced use of the fields where they have been combined to achieve the required result. The multi field "<multi:invoice>" in this case will iterate through all invoices for a particular matter and create a row for each of the invoices.

The <e:i-out> field tells SILQ to remove the row for a particular invoice if the amount outstanding for the invoiced is zero. As such this will generate a list of outstanding invoices for the selected matter.

Variable Syntax

SILQ Variables have a very specific format so that when the template is processed SILQ can recognise exactly what to do with it. Below is the definition of how variables should look.

<vartype:varname[:varformattype[:varformatextra]]>

vartype: This variable type directs the template system as to what sort of action it should take in this instance, as per the list of variable types below.

varname: This is the name of the value that the action is to act on.
varformattype [optional]: this indicates how the value should be formatted, as per the

Format Types below

varformatextra [optional]: this is extra information about how the variable should be formatted., as per the Format Types below

Variable Name 

When using the I, E, N, PE, or PN variable types, this is the name of the variable as set in the merge field list, that will be used as the source of data for the operation.
If you are using a multi field, it indicates which database it is to iterate through. A full list of these can be found in the template editor.

Examples
<i:i-date:d:18> 
This will insert the "i-date" field (which is invoice's date value), and then

format it as a date, using the 18th date format (which is the windows long date format) <i:i-date> This will insert the i-date field and use the default formatting for that field

<multi:invoice:date> Iterate through the invoices for the selected matter and order it by the invoice date.

Multi Variables

Multi variables are what set SILQ apart from most mail merge systems. It allows you to generate rows of data that are relevant to the currently selected record.

Multis variables are of the form <multi:value:order>

The value tells the system which database to iterate through. This is generally context sensitive so it know what records to get. Ie when generating the Chronology multi it needs to know which matter it is being done for.

Example values are:
WIP: 
This will iterate through all of the Time Costed entries for the selected Invoice Disb: This will iterate through all of the Disbursement entries for the selected Invoice. Invoice: This will iterate through all of the Invoices for the selected Matter.
FirmInv: This will iterate through all of the Invoices for the selected Client
Auth: This will iterate through all of the Authority entries for the selected Matter. Chrono: This will iterate through all of the Chronology entries for the selected Matter. Estitem: This will iterate through all of the Estimate items for the selected Matter.

Many of the multi's have alternative order options so that you can have the records generated in a specific order. Refer to the template editor for the full list.