Online Help

Help Table of Contents

Creating Display Templates for a Content Type

When creating a content type, it is generally recommended that you create at least one single and one list display template for that type.

This section contains the following topics:

Using the Insert Template Field Tool

The Insert Template Field Insert Template Field Tool tool is available on the HTML Editor toolbar when you edit a single or list display template. Use the tool to insert fields that you want to display on the published Web page for individual or listed items of a given content type. If you do not insert a field, values for that field will not display.

The drop-down menu lists the following:

  • Standard or custom fields already configured for the Authoring Wizard Properties step of the content type - When you select a field to insert, a line like the following is inserted into the template source code:

    "<P><SPAN class=templateVariable contentEditable=false>«title»</SPAN></P>"

  • A Body field - If you select this option, the following line is inserted into the source code:

    "<t:value id=body>«body»</t:value>"

    Online Help Note Note: Inserting the Body template field here is different from inserting Body Text using the headers menu, which inserts the line:

    "<P class=templateBody>&nbsp;</P>"

Example

Your Press Release content type might have a category-backed field called Rating, with options such as Family, Teen, and Mature. Authors select a Rating whenever they create a Press Release item. You can choose to keep the field internal, using the Ratings to filter lists but not displaying the actual rating on the published page. You can create a content filter and apply it to a list of press releases so that only those with a Family rating display in the Kids section of your Web site. If you want to display the rating of each Press Release to the public, use the Insert Template Field tool to insert the Rating field in the single or list display template for the Press Release content type.

Configuring a Single Display Template

To create a single display template

  1. Navigate to a content type administration page.
  2. In the Display Templates area, click New Template.
  3. Provide a label for the template, such as Single Press Release.
  4. (Optional) Provide a more detailed brief description of the template, such as Primary single template for Press Releases. This description is for internal use only, displaying to administrators viewing the content type administration page. It is not indexed for administrative (advanced) or public search results.
  5. Select Use as the default display template if you want all individual items of this type to default to this display.
  6. Click Create.
  7. In the next screen, click the Insert Template Field button on the toolbar.
  8. Select a field that you want to appear in all published items of this type, and click OK. For instance, the Properties step of your Press Release content type might include the standard fields Title and Description, plus the custom fields Headline, Subhead, Location, and Dateline. You may wish to insert all fields into the display template except Title and Description, which are usually for internal use.
  9. Press Enter.
  10. Repeat as needed to insert more fields.
  11. Configure the template to display the body content of each item. This is the content that authors will create either in the Authoring Wizard Body Content step, or in a Rich Text element configured as the page body.
    1. Place the cursor where you want the content to display.
    2. From the first dropdown menu in the toolbar, select Body Text. (The default is Normal.) A Body Text field is inserted in the display template. Any body content that authors enter will display in this location on live Web pages.
  12. Click Save. Your new template appears in the Display Templates list for the content type.

To add static content to a single display template

You can also add "static" content directly to the display template if you want that content to appear in all single items of this type.

For instance, if you want a particular logo or image to appear at the top of all Press Releases, add it to the single display template:

  1. Place your cursor where you want to insert the image.
  2. Click Insert Image on the toolbar.
  3. Browse to select the image.
  4. Click OK.

Configuring a List Display Template

For items of any content type to be displayed as a list, you must configure at least one list display template for that type. A list can then be created by inserting a list-based component that references the list display template.

To create a list display template

  1. Select the content type you want to edit, such as Press Release, from the Content Types menu of the navigation bar. Or click a content type on the Content Types list page. The content type administration page appears.
  2. In the Display Templates area, click New Template. The Edit Template properties page displays.
  3. Provide a label for the template, such as List of Press Releases.
  4. (Optional) Provide a more detailed brief description of the template, such as Primary list template for Press Releases. This description is for internal use only, displaying to administrators viewing the content type administration page. It is not indexed for administrative (advanced) or public search results.
  5. Leave the checkbox Use as the default display template unselected.
  6. Click Create. The Edit Template body content page displays.
  7. Click the Insert Template Field tool on the HTML Editor toolbar. Any fields defined for the Authoring Wizard Properties step of this content type are available for selection here.

    You use this tool to select fields to display for each item in a list of items of this type on a live Web page. Unselected fields will not display in the list.

  8. Select Title. The field is inserted into the template as HTML code.
  9. Right-click without moving your cursor.
  10. Select Repeat from the popup menu. A dashed green line (the Repeat box) frames the field you just inserted, making this a repeating field and thus a list.
  11. Click to the right of the field and press the spacebar to add one space.
  12. Insert a separator, such as a "pipe" ( | ). The separator will separate the Title field and the next field in the published list.
  13. Click the Insert Template Field tool again, and select another field (such as Date and Location, for a press release). The field you select is inserted, also inside the green Repeat box.
  14. (Optional) You can also enable pagination for your list by using the Pagination Control component. The Pagination component works in conjunction with the List component.
  15. Click Save.

Related Topics