Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Define templates for Pages' children in Radiant CMS.
branch: master

This branch is 21 commits behind Aissac:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
app/views/admin
lib
spec
LICENSE
README.md
Rakefile
stereotype_extension.rb

README.md

Radiant Stereotype Extension

About

An extension by Aissac that adds templating support to Radiant CMS.

Features

  • Define named templates (stereotypes) for Pages;
  • Templates are assigned per-parent Page, making all children have the defined 'stereotype' by their parent;
  • You can specify the new page's parts, filters, layout and page type.

Instalation

Stereotype Extension has one dependency, the Radiant Custom Fields Extension.

git submodule add git://github.com/Aissac/radiant-custom-fields-extension.git vendor/extensions/custom_fields

Because Stereotype Extension keeps the settings in the Radiant::Config table it is highly recommended to install the Settings Extension

git submodule add git://github.com/Squeegy/radiant-settings.git vendor/extensions/settings

Finally, install the Stereotype Extension

git submodule add git://github.com/Aissac/radiant-stereotype-extension.git vendor/extensions/stereotype

Configuration

To add stereotypes you need to add fields to the Radiant::Config table. There are three types of settings for each stereotype:

  1. Page Parts (and filters)

The key has to look like: stereotype.<name_of_the_stereotype>.parts and the value body:markdown,sidebar:textile.

  1. Layout

The key has to look like: stereotype.<name_of_the_stereotype>.layout and the value has to be the name of a layout (case sensitive)

  1. Page type

The key should look like: stereotype.<name_of_the_stereotype>.page_type and the value has to be a valid class_name attribute of the Page class. (Examples: ArchivePage, FileNotFoundPage or ArchiveMonthIndexPage)

Usage

  1. Add stereotypes as described in the configuration section.

  2. Edit/create a new page that has children and select a stereotype from the dropdown labeled "Stereotype". Child pages added to this page will be created with their attributes set by default to the fields you configured.

  3. ...

  4. Profit!

Contributors

  • Cristi Duma
  • Istvan Hoka
Something went wrong with that request. Please try again.