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:

  1. On the menu bar, click Publisher > Templates.

  2. On the Templates page, on the template you want to modify, click edit icon.

  3. In the Sitecore Content Publisher editor, on the top toolbar, click Create Frame > Text.

  4. Drag the frame to the desired location on the template.

  5. On the VARIABLE DATA tab, in the Variable List pane, click plus sign. A new variable appears in the list.

  6. Click Edit next to the new variable and enter a name, for example NEW-SHORT-TEXT-VARIABLE.

  7. Set the Type of the new variable to Short Text.

  8. Edit the other settings for the variable as needed.

  9. In the Variable List pane, to insert the variable into the text frame, click Insert Variable. The variable is inserted between two % symbols.

  10. 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.

  11. 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.

    selected frame insert variable edit story without symbol

    The Variable Input pane still shows the text box, but the value inserted here is not displayed in the frame.

    elected frame insert variable edit story without symbol locked
  12. Click Save.

  13. To display the text variable in the template for publication editors, go to the template details page.

  14. In the top-right of the template details page, click More actions more options icon > Revalidate template force recheck.

  15. In the Revalidate template? dialog, click Continue. The text variable shows on the Variables tab of the template details page.

    revalidate template, new text variable shown

Do you have some feedback for us?

If you have suggestions for improving this article,