How to use a variable defined in a different template

The variables that you have defined in a template are, by default, accessible in that template only.

You can reuse the variables defined in other templates by adding the template that contains them as a reference.

This will give you access to those variables as if they were local.

NOTE: Using referenced templates lets you define your variables only once and make them available in multiple templates. Once you need to make a change, you can do that in a single place.

To add a referenced template

1

Make sure you have a template selected in the Quick edit or the Editor

2

Open the Manage variables window by clicking on  Variables → Manage (or press F8)

2
Click on Edit referenced templates link to open the Referenced templates window

3

Choose the template that contains the variables you want to use. Select it and add it to the list of the referenced templates (or double-click on it).
PhraseExpander will automatically ask to assign an ID to the template if missing.

The list of referenced templates is displayed in the right-pane.

4

The new variables contained in the referenced templates are added. The green arrow indicates that the variables are defined in a referenced template.

The variables are available to use as if they were defined locally in the template

To remove a referenced template

1
In the Edit variables window, click on Edit referenced templates link to open the Referenced templates window.

2
Select the referenced template you want to remove and click on the X button. Then click OK to confirm.

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