Kentico CMS 7.0 Developer's Guide

Re-using an ad-hoc page template

Re-using an ad-hoc page template

Previous topic Next topic Mail us feedback on this topic!  

Re-using an ad-hoc page template

Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic!  

In many cases, you may want to re-use an ad-hoc page template for other pages. In this case, you need to save the ad-hoc template as a new re‑usable template. The following example demonstrates how this can be done:

 

1. Open CMS Desk on the Content tab, switch to Edit mode using the main toolbar and select the new page created in the previous example.

 

2. Go to the Properties -> Template tab, where you can see that the current page is based on an ad-hoc page template.

 

devguide_clip0244

 

3. Click SaveAsNewPageTemplate Save as new template. The Save as new page template dialog opens. Fill in the following values:

 

Template display name: Page with a single editable region

Template category: General

Assign to the current document: Yes (leave it checked)

 

devguide_clip0245

 

Confirm the creation of the new page template by clicking OK.

 

Result

 

When creating pages, you can now assign the new page template by selecting it from the General category. Because the Assign to the current document option was checked, the system also automatically assigns this template to the current page instead of the previous ad-hoc template.

 

You have converted the previously created ad-hoc page template that was specifically bound to a single page into a re-usable page template that can be used for any number of pages.

 

devguide_clip0246