One template, multiple pages, varying web parts

Brendan McKenzie asked on July 15, 2014 09:05

I have a template that has a webpart zone. I want to use this template for multiple pages throughout my site and have the content of the webpart zone differ on each page. The templates are ASPX+Portal.

How can I achieve this?

At the moment if I have two pages with the same template, if I add a control to the webpart zone, it appears on both.

Correct Answer

Stefan Lorenz answered on July 15, 2014 11:22

Templates share their content. You'll have to clone the Template (Properties->Template->Save as new template). This creates an ad hoc (=unique)template based on the original one. If you edit your source page template, there's an option to always create ad-hoc templates from this source when creating a new page.

This is very useful for content templates. E.g. I have a page template "Default Content Page" with that option turned on. Everytime I create a new page based on that template, Kentico will automatically create a clone of my source template.

0 votesVote for this answer Unmark Correct answer

Recent Answers


Joshua Adams answered on July 15, 2014 15:16

You could add placeholders to the template and then share the template among pages. This would allow you to add different webparts to different pages.

0 votesVote for this answer Mark as a Correct answer

Yehuda Lando answered on July 15, 2014 22:18

You can either have two different web part zones, which have a macro in the visible property that specifies when to show it. For example: {% CurrentDocument.GetValue("IsExtended", false) #%} or {%CurrentPageInfo.NodeAliasPath == "/Page2" %}

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.