Working with Templates

As you set up your Ektron Web site, you create templates for your Web pages. A template typically includes page headers, footers, and placeholders for content, forms, summaries, and other page elements. The following image shows a template where the top of the screen contains headers that appear on several pages. Other areas contain links to Ektron objects, such as menus and text. A developer can modify content within these areas.

 

NOTE: To learn more about creating templates, see Creating a New Template and the Ektron technical article “Templating in CMS400.NET” (http://dev.ektron.com/articles.aspx?id=6724).

Using templates

Using Templates

Except for your Web site’s home page, people access your site through hyperlinks. Hyperlinks can appear within content. They also link content items from list summaries, menus, collections, and so on. A template defines the place to display the content of a hyperlink. The following example shows that when a user selects Email, content item (ID 87) displays within the contactinformation.aspx template.

Declaring a template

Declaring a Template

Prerequisite: You must be a member of the Administrators group or in the Manage Members for Role: Template Configuration screen. See Also: Defining Roles.

After creating templates, declare them within Ektron. To do this, go to the Active System Templates screen, available from Settings > Configuration > Template Configuration.

From this screen, you can add new templates, or delete or update existing ones.

Adding a template

Adding a Template

  1. Within the Ektron Workarea, navigate to Settings > Configuration > Template Configuration.
  2. Click Add New Template to System. The Add a New Template screen appears.
     

  3. Enter the path to and name of the new template or click the ellipsis button () and navigate to it.
  4. Enter a name and description for the template.
  5. Click Add New Template to System.
Deleting a template

Deleting a Template

To delete a template, click Delete in the template row.

You can only delete a template if it is not assigned as any folder’s default template. If you choose a template that is assigned as a default, a screen tells you why you cannot delete it and lists the folders for which it is the default. If you delete a template that is not used as a default but is applied to content, that content’s template is changed to its folder’s default template.

Updating a template

Updating a Template

The update procedures lets you change all references from an old to a new template. For example, your old template is named MyTemplate.aspx. You can want to replace all references to it to Updatetemplate.aspx.

  1. Within the Ektron Workarea, navigate to Settings > Configuration > Template Configuration.
  2. Click the template that you want to update. A new screen appears.
  3. Choose the new template file. You may also update the name or description.
  4. Click Update Template.

NOTE: This screen has additional fields when mobile device detection is on and mobile configurations exist. For more information, see Supporting Mobile Devices

Assigning a template to a folder

Assigning a Template to a Folder

Each folder must have at least one template and one template must be chosen as the default. By default, folders below the root folder inherit a template from their parent. However, you can assign a unique set of templates to any folder by overriding the default inheritance. To do this, go to the Edit Folder Properties screen and uncheck the box next to Inherit Parent Template Configuration.

When a folder’s default template is changed, existing template assignments remain, but new content added or moved into the folder assumes the new default template.

If you break template inheritance, inherited templates are initially assigned to the folder. You can then remove unwanted templates or add new ones. Available templates appear in the template drop-down list. Select any that you want to be available from the folder and click Add. (The list of available templates is managed through the Active System Templates screen.)

Adding a template to a folder

Adding a Template to a Folder

  1. In the Workarea, navigate to the folder to which you want to apply the template.
  2. Choose View > Properties.
  3. Click Edit Properties.
  4. Click the Templates tab.
  5. Uncheck Inherit Parent Configuration.
  6. Click the arrow next to Select Template and choose the template you want to apply to this folder.
  7. Click Update.
Removing a template from a folder

Removing a Template from a Folder

  • If you try to delete a template that is the default for a folder, you are notified that you must assign a new default to that folder before you can delete it.
  • If you try to delete a template that is assigned to a content block, you are notified via the following message If you wish to continue and delete this template, the above content will be set to their parent folder's default template. Do you wish to continue?
Assigning a template to content

Assigning a Template to Content

A folder’s default template is automatically applied to all content in the folder. However, you can change a content item’s template to any of those assigned to the folder.

  1. In the Workarea, navigate to a content item to which you want to apply the template.
  2. From the View menu of the content item, Choose View Properties. The view content screen appears.
  3. Click Edit.
  4. Click the Templates tab.
  5. Click the arrow next to Template: and choose the template you want to apply to this content item.
  6. Click Publish. The template assigned to the content will be used whenever a hyperlink is created to it.