Macro language changes

PhraseExpander 5 comes with a completely redesigned execution engine with a lot of new capabilities.

In this document, we describe the major changes you'll find in the macro language for the creation of your templates.

Variables

Manual Inputs are now called fill-in variables. They have a lighter syntax which makes the document easier to read. And they have a name, so, once defined, they can be quickly reused in the document.

Convert a block of text to a variable (or template) for reuse

Select a piece of text and convert it to a variable or a new template and reuse it in your templates

Nest and compose macros and variables

Use Macros inside other macros and variables.

Reference variables from other templates

You can define variables in a template and recall them from another template. Thus you can define a set of frequently used variables once and reuse them in your other templates. 

Adapt the variable casing

Once you have defined a variable, you can easily change its casing by adding a modifier to the variable tag.

Enabling/disabling a single variable

You cannot enable/disable a single variable but you can group variables together inside a Section macro that can be toggled.

Dynamic templates

Using variables and macros you can create templates that adapt their contents based on the selection you are making.

Flow control macros allow you to define how the template will change based on certain conditions.

If: the if macro allows you to create a different flow and changes the text generated by the template based on the value of a user input or any expression.

Section: the section macro allows you to group a block of text (including macros and variables) and toggle it by clicking on a checkbox

Insert template and Id

Reusing the contents of a template in another template is much easier now, thanks to the Id which uniquely identifies a template.

Comments

Comments are no longer macros but have their own syntax. You can comment any piece of information by surrounding it with the comment markers 

{~ This is a comment and it will not be inserted in the generated document ~}

You can easily comment or uncomment a block of text by clicking on the comment or uncomment buttons.

NOTE: Please make sure you check the breaking changes when migrating from v4 to v5
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us