Creating a Template Variable

We will show you how to create a Template Variable and how to add it to a document. We'll also look at how we can:

  1. Add variables to a template.
  2. Modify variables when editing a document.

To create a new Template Variable, open the Resource Manager and click the New Template Variable tab. Click the New Template Variable link.

On the Template Variable Editor screen enter the name of the variable (case-sensitive), a caption, a description and then select the Input type.

Input types

The Input Type defines the type of control that users see to set TV values when editing documents for the variable. Select the type of control you desire from the available list of options:

Note that different variable Input Types will result in different formatting options in the File Manager (much like toggling the Rich Text option in Evo turns on and off the Rich Text formatting tool for the main content). For example, the following screenshot shows the formatting controls and their resulting display after editing a document.
Empty TVs (Image type, File type and URL type):

The Image input controller is integrated with the HTMLarea image manager giving you a consistent way to work with images within the Admin Interface. The input values after saving the file.

Please note that the file selected with the browse button will automatically be uploaded when saving the document:

The calls to the TVs in the Document Editor.

Please note these could also be placed inside a template, much like the default

[*content*]

And the resulting display on the web page. Note that both the "datagrid.gif" and the "Click Here" are links, respectively:

The Input Option Values text box is used to provide a list of options for the select
Input Type. For example the DropDown List Menu, Listbox, Check Box and Radio
Options all require Input Option Values.

Input Option Formats:

option1==value1||option2==value2||option3==value3

or

option1||option2||option3

The == delimiter is used to assign a value to an option to be displayed, while the ||
delimiter is used to separate option values.

Example:

Red==#FF0000||Green==#00FF00||Blue==#0000FF

When the user edits a document he/she will see a list showing Red, Green and Blue
but when the data is save the values #FF0000, #00FF00 or #0000FF will be the
actual value saved to the database.

In the case of

option1||option2

the value displayed is the value saved. For Example,

options Red||Green||Blue

will be saved as Red, Green or Blue.

Default Value

The Default Value text box is used to set the default value for the variable. Default values like the Input Option Values can be separated by using the || delimiter. This is useful in cases where you want the user to be presented with a default set of selected values.

Consider the following Input Option Values for a Multi-Select Listbox or Check Box

Input Type:

Toyota||Honda||Mazda||Nissan

To make the options Honda and Nissan selected by default you would set the Default

Honda||Nissan

When the user edits a document he/she will be presented with the list of cars with Honda and Nissan selected by default.

Display Type

The Display Type option is used to define the format in which the variable will be displayed on the web. There are two types of display formats - Static and Dynamic. Dynamic formats are used to move, change or modify the display of the variable. For example, the Ticker display format can be used to display one message at a time, while the Marquee can be used to scroll the messages stored inside the variable.

Example:

Note: Multiple values to be displayed by the Ticker are separated using the || delimiter.

When displayed on the web you'll see one message being displayed at a time, and in supported browsers, transition effects between messages (Win IE 5.5 and above):

In addition to the above you can modify the properties of the Ticker as shown below:

Tickers are automatically wrapped in a DIV with the name "#tvVariable_Name", where Variable_Name is the name of your variable. You can use this to style you TV DIV (example below), use the Style parameter for inline styling, or enter a Class name in the Class parameter box (or use all three!).

<style>
#tvMyCars{
padding:3px;
font:bold 12px/12px Verdana;
width:200px;
filter:progid:DXImageTransform.Microsoft.GradientWipe(GradientSize=1.0 Duration=0.7);
}
</style>

Sort Order

This is used specify the order in which this variable will be displayed when editing a document.
Example of a complete variable:

Template Access

This section allows you to select the templates that are allowed to process the selected variable.

In the above example, only documents assigned to the "AlexisPro Redux" template are allowed to process, customize and display the selected variable.

Access Permissions

This section allows you specify the document groups for documents that are allowed to modify the selected variable when editing the document.

To make the variable public to all documents check the "All Documents (Public)" check box. Selecting document groups will only make the variable accessible to the to the selected groups.

You can now click on the Save button to save your new variable.

Suggest an edit to this page.