---
title: Adding portal engine functionality to ASPX page templates
related:
  - https://docs.kentico.com/k9/developing-websites/developing-websites-using-aspx-templates/creating-aspx-page-templates.md
  - https://docs.kentico.com/k9/developing-websites/developing-websites-using-aspx-templates/creating-master-pages-for-aspx-templates.md
  - https://docs.kentico.com/k9/developing-websites/developing-websites-using-the-portal-engine.md
  - https://docs.kentico.com/k9/developing-websites/developing-websites-using-the-portal-engine/using-and-configuring-web-parts.md
  - https://docs.kentico.com/k9/developing-websites/preparing-widgets-for-users.md
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

When developing or maintaining websites built on [ASPX page templates](https://docs.kentico.com/k9/developing-websites/developing-websites-using-aspx-templates.md), one of the drawbacks is that you need to manually modify the code of pages whenever you wish to change the design. You can add flexibility to ASPX templates by defining areas that are editable directly through the browser in the **Pages** application, just like when using the [Portal engine development model](https://docs.kentico.com/k9/developing-websites/developing-websites-using-the-portal-engine.md). These areas allow you to add [Web parts](https://docs.kentico.com/k9/developing-websites/developing-websites-using-the-portal-engine/using-and-configuring-web-parts.md) or [Widgets](https://docs.kentico.com/k9/developing-websites/preparing-widgets-for-users.md) onto ASPX page templates.

Add the following elements to the code of your page templates to integrate portal engine areas:

```html

 <cms:CMSPagePlaceholder ID="plcZones" runat="server">
    <LayoutTemplate>

        ...

        <cms:CMSWebPartZone ID="zoneCenter" runat="server" />

        ...

    </LayoutTemplate>
</cms:CMSPagePlaceholder>

```

- The **CMSPagePlaceholder** control creates an area on the page that behaves like a portal engine page template. You can place multiple _CMSPagePlaceholder_ controls onto a single page.
- The content of the **** element defines the layout of the area. You can specify a table structure or a CSS-based layout applies through HTML elements (, , etc.).
- The layout may contain multiple **CMSWebPartZone** controls, which represent fully functional portal engine zones. You can configure every zone to serve as either a standard web part zone or any type of widget zone. Users can manage these zones when editing pages based on the page template on the **Design** tab of the **Pages** application. When web part or widget content is added to a zone, information about it is stored in the database along with the respective page template object, not in the actual code of the ASPX page.

> **Note:** **CMSPortalManager control required**
>
> The **CMSPortalManager** control must be present on ASPX templates that contain portal engine functionality. The typical solution is to provide the control through the [master page](https://docs.kentico.com/k9/developing-websites/developing-websites-using-aspx-templates/creating-master-pages-for-aspx-templates.md) of your templates.

When registering ASPX page templates with portal engine functionality in the **Page templates** application, you need to set the **Template type** to _**ASPX + Portal page**_. This enables the **Design** tab when editing pages based on the template in the **Pages** application.

![](https://docs.kentico.com/docsassets/k9/adding-portal-engine-functionality-to-aspx-page-templates/Mixed_Template.png)

## Example

The following example demonstrates how to create an ASPX page template with zones that users can design via the portal engine:

1. Build a new page template according to the example on the [Creating ASPX page templates](https://docs.kentico.com/k9/developing-websites/developing-websites-using-aspx-templates/creating-aspx-page-templates.md) page.

   - When writing the template's ASPX code, place the following inside the **** element:

     ```xml

     <cms:CMSPagePlaceholder ID="plcZones" runat="server">
         <LayoutTemplate>
             <table style="width:100%">
                 <tr>
                   <td style="width: 50%">
                     <cms:CMSWebPartZone ID="zoneLeft" runat="server" />
                   </td>
                   <td style="width: 50%">
                     <cms:CMSWebPartZone ID="zoneRight" runat="server" />
                   </td>
                 </tr>
             </table>
         </LayoutTemplate>
     </cms:CMSPagePlaceholder>

     ```

     > **Info:** This code defines two editable web part zones in a basic two column table layout.
   - When registering the template in the **Page templates** application, set the **Template type** to _**ASPX + Portal page**_.
2. Open the **Pages** application and [add](https://docs.kentico.com/k9/managing-website-content/working-with-pages/creating-new-pages.md) a **Page (Menu item)** page to the content tree using the new page template.
3. Switch to the **Design** tab of the new page. You can see two web part zones on the page.
4. Expand the menu () of the **zoneLeft** zone and click **Configure**.
5. Switch the **Widget zone type** property from _None_ to _Customization by page editor_.
6. Click **Save & Close**.

   - The zone now serves as a widget zone for page editors.
7. [Add a web part](https://docs.kentico.com/k9/developing-websites/developing-websites-using-the-portal-engine/using-and-configuring-web-parts.md) to **zoneRight**, for example **Editable text**.

   ![](https://docs.kentico.com/docsassets/k9/adding-portal-engine-functionality-to-aspx-page-templates/ASPX_Mixed_Design.png)
8. Open the **Page** tab.

   - Here you can manage the editor widget zone on the left and enter content into the editable text region displayed by the web part on the right.
9. Open the menu of the editor zone () and click **Add new widget** to place some widgets onto the page.
10. **Save** the page.

![Editing widgets and editable region content of a page based on a mixed template](https://docs.kentico.com/docsassets/k9/adding-portal-engine-functionality-to-aspx-page-templates/ASPX_Mixed_Result.png "Editing widgets and editable region content of a page based on a mixed template")

The example demonstrates how to use web parts or widgets to build the design of pages based on ASPX page templates. This approach combines the standard architecture and development process of ASPX templates with the flexibility and user‑friendliness of the portal engine.
