logo
logo

Configuration examples

This document shows you configuration examples that you can follow to edit your templates.

Create a frame and assign a DAM asset

In this example, you create an image frame and set it with an asset from Sitecore Digital Asset Management (DAM)™.

To create the image frame and assign an asset to it:

  1. On the Chili editor, on the top toolbar, click Create Frame:
  2. In the drop-down list, select the Image type:
  3. Drag the new empty frame that appeared to the area of the template you want. Here, we placed the frame in the top-right corner:
  4. On the IMAGE tab, on the Image Settings panel, click Assign Image.
  5. On the SELECT IMAGE dialog box, select an asset from Sitecore DAM:
  6. The asset shows in the new frame:

Create an image variable

In this example, you create a new image variable, associate it to a frame, and expose it to the publication editors.

To create an image variable and link it to a frame:

  1. On the Chili editor, select the Variable Data tab:
  2. On the Variable List panel, click Add variable .
  3. A new variable called New Variable appears on the list:
  4. Optionally, to edit the new variable settings, click Edit .
  5. On the Chili editor, on the top tool bar, click Create Frame:
  6. In the drop-down list, select the Image type:
  7. On the IMAGE tab, on the Image Settings panel, in the Variable drop-down list, select New variable:
  8. On the VARIABLES tab, on the Variable Input panel, next to New variable, click .
  9. On the SELECT IMAGE dialog box, double click an asset to select it:
  10. On the FRAME tab, on the Frame Location panel, insert a value in the Tag field:
  11. Click Save.
  12. To display the image variable in the template for publication editors, go to the template detail page.
  13. On the top-right of the template detail page, click More actions , then click Revalidate template :
  14. On the Revalidate template? dialog box, click Continue:
  15. After the validation process, the image variable shows as a dynamic frame:
Note

To display frames in a publication, they must have a Tag. Re-validating a template deletes the previous mappings.

Create a text variable

In this example, you create a text variable, associate it to a frame, and set a value to it.

  1. To create a text variable, follow steps 1. to 4. of the previous create an image variable example. Call the new variable NEW-SHORT-TEXT-VARIABLE and set its Type as Short Text:
  2. On the Chili editor, on the top toolbar, click Create Frame, then click Text:
  3. Drag the frame where you want on the template.
  4. On the VARIABLE DATA tab:
    • On the Variable Tools panel, click Selected frame contains variable.
    • On the Variable List panel, select NEW-SHORT-TEXT-VARIABLE.
  5. On the unanchored text toolbar or the Variable tools panel, click Edit Story:
  6. On the Variable List panel, to insert the variable into the text frame, click Insert Variable:

    The variable is inserted between two % symbols:

  7. To return to the document, click Close:

  8. The new variable with a blank text box shows on the Variable Input panel of the VARIABLES tab:
  9. If you do not use the % around the text variable, the text is inserted directly into the text frame:
  10. However, the Variable Input panel still shows the textbox, but the value inserted here is not displayed in the frame:
  11. Revalidate the template by following steps 12. to 14. of the previous create an image variable example.
  12. After the validation process, the text variable shows in the Variables tab of the template detail page:

Exposing variables to publication

In this example, you expose template variables previously created into the publication editor.

To expose variables:

  1. On the template detail page, on the Variables tab, click Edit .
  2. In the drop-down list, select the variables you want to expose:
  3. Click Save.

    The variables show:

    • On the right tabs of the publication editor page:

    • On the right tabs of the template editor page for quick edit:

Add a result set to a dynamic frame

In this example, you create a dynamic frame with a result set of assets and add a condition.

To create the dynamic frame:

  1. On the template detail page, on the Dynamic frames tab, click + Dynamic frame.
  2. On the Dynamic frame dialog box, in the Frame drop-down list, select Drink image:
  3. On the Contents tab, turn on the Allow upload and Allow delete switches:
  4. Click Add result set.
  5. In the Result set drop-down list, select Asset:
  6. Click Select:
  7. On the Select result set dialog box, select the assets you want to link to the frame:
  8. Click Select.
  9. Click Add condition.
  10. In the If drop-down list, select the Brand layout:
  11. In the is text box, type the brand name Fruitful:
  12. Click Save.
  13. As a result, Fruitful is linked to the variable of Brand.

    This shows on the Variable input panel of the VARIABLES tab, on the Chili template editor:

Add a mapping to a dynamic frame

In this example, you add a mapping to a dynamic frame.

To add a mapping to a dynamic frame:

  1. On the template detail page, on the Dynamic frames tab, click + Dynamic frame.
  2. On the Dynamic frame dialog box, in the Frame drop-down list, select Drink image:
  3. On the Mappings tab, click Add mapping:
  4. Set the Source relation, Store property, and In Template value drop-down lists as follow:
  5. Click Save
Note

If you do not select a source relation, metadata from the asset itself fills the template value. You can add several mappings to the same dynamic frame.

Add a variable mapping to a trigger

In this example, you create a trigger and add a variable mapping to it.

To create a trigger with a variable mapping:

  1. On the template detail page, on the Triggers tab, click + Trigger.
  2. On the Trigger dialog box, in the Source relation drop-down list, select Product:
  3. Click Add mapping:
  4. In the Store property drop-down list, select the property Short description:
  5. In the in template variable drop-down list, select the variable Description - Food:
  6. Click Save:

Trigger frame mapping

Frame mappings automatically fill out template frames with linked assets. This link is created between an entity from the selected Source relation and the template frames.

The linked assets must have a ChiliType value:

In the following example, the Source relation is Products and the trigger has two mappings:

Can we improve this article ? Provide feedback