Skip to content
This repository has been archived by the owner on Jan 12, 2023. It is now read-only.

Latest commit

 

History

History
63 lines (42 loc) · 3.24 KB

HELP_designer.textile

File metadata and controls

63 lines (42 loc) · 3.24 KB

The Templates extension provides internal structure to Radiant pages, adding a layer of flexibility in Layout development. This allows a single Layout to serve as a wireframe for the entire site, with many different template page designs filling the “content well.” Using templates, you now only need a single tag within the Layout. Thus we simplify and ensure layout consistency in the creation of pages by the end user of the CMS.

Usage

Creating a template

For each new template:

  • Add the template parts, specifying the part type, and their filters. Each part will be editable in the page interface.
  • Create the structure of the page, using the template parts you have created.
  • Specify the Layout and page class that will be used by pages with a given template.

Let’s say I want a template for press releases. Press releases consist of a short description which also serves as the first paragraph, a longer description, a location, contact information, and standard information about the company. So I would create the new template like so:

The template parts

For each template part, you specify name, description, type (part type) and filter (formatting filter like Textile or Markdown):

The would be, respectively, for the needed parts:

  1. Location, City of Origin, One-line, none
  2. Short description, Introductory blurb, One-line, none
  3. Long description, The full text of the Press Release, Plain textarea, Textile
  4. Contact information, Whom to contact for details, Plain textarea, Textile

The structure

Now you set the structure (which becomes the ‘body’ page-part) to be something like:


<div class="press-release">
  <p class="contact"><r:content part="Contact information" /></p>
  <p><strong><r:date format="%d %m %Y"/>,  
    <r:content part="Location"/></strong> - 
    <r:content part="Short description"/>
  </p>
  <r:content part="Long description" />
  <r:snippet name="corporate-press-release-blurb" />
</div>

This will not be visible to the Page Editors. They will only see the Template parts you’ve defined, along with their descriptions as form field labels.

Layout and Page Type

Finally, at the bottom of the Edit page, set the Layout (normally your standard one), and Page Type according to preference. These cannot be changed by the Page editors.

Applying a template

Creating a new page

  • Click “Add Child” to create a child page an existing page.
  • Dropdown menu appears listing “Blank Page” (no template), and all the currently defined templates.
  • Select the template you wish for the new page.
  • Voilá. Now just fill in the template-defined page parts.

Changing the template for an existing page

  • When editing a page, you will see the Template Selector at the top left, just to the right of the ’Edit Page header.
  • Click this to see all available templates
  • To change to another template, simply select it, and then save the page (Simply selecting it will not change it — you must save the page).

WARNING: For page parts of your old template, if your new template does a page parts of the same name, then that content will be lost. This is a good reason to follow naming standards when creating templates, e.g. define a page part “main_content” for all your templates.