Kentico CMS 7.0 Developer's Guide

Cloning and modifying a page template

Cloning and modifying a page template

Previous topic Next topic Mail us feedback on this topic!  

Cloning and modifying a page template

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

You may need to create a new page that will be similar to existing pages, but with some minor modifications of the page template. For example, if you wish to display the editable region from the previously created page template in a container box.


Instead of creating the page template from scratch, simply create a new page based on your existing page template.




Then select the page in the content tree, navigate to its Properties -> Template tab and click CloneAsAdHoc Clone template as ad-hoc. A new ad-hoc template is now created and you can edit it without modifying the existing pages based on the original template.




Now switch to the Design tab and click the Configure (Configure) button of the Editable text web part. Select the Black box container from the Web part container drop-down list and enter What's new into the Container title property.




Click OK. Switch to the Page tab and enter some text into the editable region. Click Save Save and select Live site mode through the main toolbar. You will see a page like this:




As you can see, the text is now surrounded by a black container. When you check the original My test page, you will see that it still uses the original design and it wasn't affected by the change made to the new copy of the page template.





Re-using the modified template


If you want to use the new, adjusted page template for other pages, you can save it as a named template by clicking the SaveAsNewPageTemplate Save as new template action on the Properties -> Template tab.







Please keep in mind that when you create a page based on an ad-hoc page template and later delete the page, the corresponding ad-hoc page template will also be deleted and cannot be restored.