What is a Page Type?
If you have made a new page in your site by Adding a Page, you had to pick a Page Type for that new page.
Excluding Single Pages which are made by adding PHP files by hand, every page in your site tree must be typed.
Creating Page Types
You can create new page types from Dashboard > Pages & Themes > Page Types.
- Name - This is displayed when creating or editing a page to the site editor, it may contain spaces.
- Handle - This is used on the backend as a unique identifier. It may not contain spaces or special characters.
- Icon - The icons can be managed through the file manager and just provide a simple visual cue.
- Attributes - You can add any custom attribute to any page from edit mode, this list defines which attributes will be displayed in Properties by default.
Page Types are very powerful and with their relationship to Themes they can solve a great many problems. It's important to remember that Page Types are created as objects in the database, while Themes are a collection of files that define the outer HTML/CSS needed to render your page.
NOTE: If a file exists in your theme matching the handle for the page type, that file is used to render the page. If no file matches the page type handle, default.php is used for rendering.
This flexibility means page types can be used in one of two ways:
Since every page type can map to a specific template file in a chosen theme, it's easy to see page types as primarely form factors. Left side bar vs. right side bar. The only difference between these page types is the positioning of the DIV's in the template files.
Page types are easily used for things like searching and filtering throughout concrete5. By adding the flexibility of custom attributes, its easy to use Page types as the building blocks of a custom data model. Look at the example Blog and Right Sidebar page types in the default concrete5 install. The templates are the same, but several custom attributes including release date and media type have been added to the blog page type to handle the custom formatting of a blog post.