Kentico CMS 7.0 Developer's Guide

Combining ASPX templates and portal engine templates

Combining ASPX templates and portal engine templates

Previous topic Next topic Mail us feedback on this topic!  

Combining ASPX templates and portal engine templates

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

It is possible to combine ASPX page templates and Portal engine page templates on the same website.

 

Note: When creating websites with both ASPX template and portal engine pages, you need to make sure that the portal engine pages have visual inheritance disabled for all ancestors that use ASPX page templates.

 

Sharing a master page on hybrid websites

 

If you have a website built using the portal engine development model, the master page and all other pages use portal engine page templates. Unfortunately, you cannot "insert" ASPX pages directly into the portal engine master page.

 

However, you can use the following workaround:

 

1. Create a copy of your portal engine master template as an ASPX master page (.master file) and assign it to your ASPX templates.

oThis scenario works, but the drawback is that you now need to manage the master page in two locations.

 

2. Take all content (HTML and controls) that you have above the Page placeholder web part on the portal master page and place it into a new user control named Header.ascx.

 

3. Take all content from below the Page placeholder and place it into a user control named Footer.ascx.

 

devguide_clip0273

 

4. Delete the content of your portal engine master page and replace it with the following web parts:

 

User control - set the User control virtual path property to load Header.ascx

Page placeholder

User control - set the User control virtual path property to load Footer.ascx

 

5. Remove the content from your ASPX master page and replace it with the following controls:

 

the Header.ascx user control

the ContentPlaceHolder control

the Footer.ascx user control

 

You can now manage the header and footer in a single place for both the portal engine and ASPX master page.