Example - create a text variable
In this example, you create a short text variable, associate it with a frame, and assign it a value.
To create a text variable:
-
On the menu bar, click Publisher > Templates.
-
On the Templates page, on the template you want to modify, click
.
-
In the Sitecore Content Publisher editor, on the top toolbar, click Create Frame > Text.
-
Drag the frame to the desired location on the template.
-
On the VARIABLE DATA tab, in the Variable List pane, click
. A new variable appears in the list.
-
Click Edit next to the new variable and enter a name, for example NEW-SHORT-TEXT-VARIABLE.
-
Set the Type of the new variable to Short Text.
-
Edit the other settings for the variable as needed.
-
In the Variable List pane, to insert the variable into the text frame, click Insert Variable. The variable is inserted between two
%
symbols. -
To return to the document, click Close. The new variable is displayed on the VARIABLES tab, in the Variable Input pane, in a blank text box. If you don't use the
%
symbol, the text is inserted directly into the text frame. -
To fill the text variable with placeholder text, on the VARIABLES tab, in the Variable Input pane, enter the placeholder text in the text box next to NEW-SHORT-TEXT-VARIABLE.
The Variable Input pane still shows the text box, but the value inserted here is not displayed in the frame.
-
Click Save.
-
To display the text variable in the template for publication editors, go to the template details page.
-
In the top-right of the template details page, click More actions
> Revalidate template
.
-
In the Revalidate template? dialog, click Continue. The text variable shows on the Variables tab of the template details page.