Page Templates
In Concrete CMS, Page Templates define the visual layout of your pages, while Page Types manage the underlying data structure. This separation allows for flexible design and content management across your site.
Understanding Page Templates
Each theme in Concrete can include multiple Page Templates, which serve as reusable visual formats for different page layouts by mapping to matching PHP files within a theme. Common examples include:
- Left Sidebar: Features a sidebar aligned to the left.
- Right Sidebar: Features a sidebar aligned to the right.
- Full Width: Utilizes the entire page width without sidebars.
- Homepage: A specialized layout for the main landing page.
These templates can be applied to various Page Types, allowing the same content structure to be presented in different layouts.
Managing Page Templates
To view and manage Page Templates:
- Navigate to the Dashboard.
- Go to Pages & Themes.
- Click on Page Templates.
Here, you can see all available templates, modify their names, and update their representative icons. If you’re developing a new template, this is where you inform Concrete CMS about its existence.
Adding a New Page Template
To create a new Page Template:
- Click Add Template.
- Fill in the following details:
- Name: A human-readable name for the template.
- Handle: A unique identifier using lowercase letters and underscores (e.g.,
left_sidebar
). - Icon: Choose an icon to represent the template.
- Click Save to add the new template to the list.
Ensure that a corresponding PHP file with the handle’s name (e.g., left_sidebar.php
) exists in your active theme’s directory. If not, Concrete will default to using default.php
for rendering.
Setting Default Content with Page Template Defaults
Page Template Defaults allow administrators to define default blocks and content that automatically appear when new pages are created using a specific Page Type and Template combination. This feature is particularly useful when certain blocks or content should consistently appear across multiple pages.
To configure Page Template Defaults:
- In the Dashboard, go to Pages & Themes.
- Click on Page Types to see a list of all installed page types.
- Next to the desired Page Type, click the Output button.
- You’ll see a list of compatible Page Templates for that Page Type. Click the template you want to modify.
This opens an editable version of the template where you can add or modify blocks and settings. These configurations will be applied to all new pages that use this Page Type and Template combination.
Applying Changes to Existing Pages
Modifications made in Page Template Defaults do not affect existing pages unless you choose to apply them. To push changes to existing pages:
- After editing the defaults, use the Set Up on Child Pages option.
- This action will propagate the changes to all existing pages that use the specified Page Type and Template.
This feature ensures consistency across your site without the need to manually update each page.
By effectively utilizing Page Templates and Page Template Defaults, you can maintain a consistent and efficient design framework across your Concrete site.