Page Templates in Agility represents a page's layout. This enables a variety of layouts where editors can add Page Modules to one or more Content Zones.
When editors create pages in Agility CMS, they must select which template they'd like to use from a list of pre-defined Templates which you, the developer, have created for them.
As a developer, you can decide how the template is rendered into HTML.
Each template has Content Zones which are areas where editors can enter pieces of content. These are called Page Modules, and they can be added, removed, and rearranged within these zones to structure a page.
For example, you may have a simple Page Template named Main Template that is used for your Home or About Page with a single Content Zone.
You might also have a more complex Page Template called Two Column Template that has two Content Zones, a Main Content Zone, and a Sidebar Content Zone which can be used for a News or Blog Listing Page.
The bulk of the Content and Page Modules on the page can reside within the Main Content Zone, and the Sidebar Content Zone can contain a Page Module that displays The Latest, or Related Posts or News Articles.
1. Navigate to page templates by clicking on Models > Page Templates
2. Click on Add.
Each page template has the following items:
3. Enter the Name of the Page Template.
4. Add Content Zones by clicking + button.
5. Fill in Display Name (this will automatically populate the Reference Name) and if desired add Default Modules that will be automatically added to the page template by clicking the + button.
A shared module zone is when you specify a content zone that it will be shared across all pages that use the same template. For example, if you had a sidebar content zone and you want the content to be the same across multiple pages.
Now you can see your newly created Page Template in the list.
Editors can start to use your Page Template when they create new pages. Editors may also migrate an existing page to use the new Page Template and copy over any Page Modules they want to keep.
In order to handle the rendering for the new Page Template in your solution, you'll need to have code that will be responsible for rendering the template.
If you have a case where editors consistently build pages with similar layouts, you can set up Default Modules that are associated with each Content Zone on the Page Template.
When editors create a page using that template, they'll immediately see the Page Modules that are associated with the template that they need to enter content for.