In a typical web solution based on Agility, there will be a number of templates used to define the layout of a page. You can see how we have set up our Sample Site in Agility, by selecting the Settings link at the top of the page and then clicking on Page Templates. Here, you will see a Default Template and a Home Page Template. This means that we have a single template used to define the layout of the home page, and a second template used to define the layout of all the other pages in the website. You can have as many templates as you choose, but it is good practice to narrow down the designs as much as possible so that content editors have a concise list to choose from.
A page template consists of three basic properties in the General Settings tab (click on the Home Page Template to open its properties dialog):
- Name – this is simply a title used to identify the template
- Relative URL – this is a URL relative to your website path that locates the physical web page (.aspx file) of the template.
- Use on page(s) – this is a list of pages that we can use to restrict the use of a template. For example, we could add “Home” here to the Homepage Template to ensure content editors were not able to use the homepage layout on other subpages.
A page template then has a second tab containing a list of all the module zones - these are the areas in which a content editor can add modules when creating a page. In reality, a module zone is div on the physical page of the template with a runat=”server” tag, and a useful id. In the Homepage Template, we have three zones already defined – Splash Zone, Main Content Zone, and Right Column Zone. Each of these in turn has a number of properties:
- Display Name – similar to the Name of the title, this is simply the identifier of the zone that the content editor will see when they are creating a page.
- Reference Name – this is what you will use when defining the div elements on your physical template page. The reference name will be the id of the div, and used by the Agility dll to work out where to render each module.
- Default modules – this is often used by Architects to define a default structure of a set of pages. For example, you may have page template that defines a certain area of a website like News, and you may want to ensure a certain module appears on each of these pages (like “Top Stories” or “Most Read”) – in this case, you would add this module to the default modules list here. Content editors can always remove the modules if they don’t want them on a particular page.