Sign In
Start Page | Recent Changes | All Pages | Orphan Pages | Junebug Help

Layouts

If you select the Layouts tab at the top of the Radiant administration interface you’ll be presented with a list of layouts – an empty list, if you’ve never created any before. The New Layout button at the bottom of the list leads to a form consisting of a large name and body text field. Below the name field is a small More link, which if selected will add a content type field to the form. Layout names can’t contain spaces or tabs. Sticking to lower case letters with underscores separating the words is a reasonable rule if you’re used to creating Web sites by hand, as they mimic the sort of filenames with which you may already be familiar, although filename extensions are not necessary. There is an internal 100 character limit on name lengths and layout names must be unique.

As well as including page content and snippets, one layout can include another layout, which is where the content type field comes in – layouts default to text/xhtml content, but you could create a layout holding a stylesheet with content style text/css or you might just want to go retro and use earlier HTML versions with a text/html content type.

Layouts are written in whatever language is appropriate for the content type you selected (or text/xhtml if you’ve left it at the default setting). Usually this means HTML – no Textile or Markdown here. You should be careful to ensure that, where applicable, the layout will produce a syntactically valid document when served with its associated snippets and page content, assuming the snippets and pages themselves are valid. For HTML and CSS, the online validation services from the W3C can help enormously. Get this right once and you won’t have to worry again for the rest of the site, since pages and snippets do support filters such as Textile, in which case the filter ensures that the HTML is valid. At the time of writing, Textile is supported through RedCloth and Markdown through BlueCloth, unless your Radiant installation has been extended with extra filters.

In addition to the HTML, text or CSS you might be creating for a layout, Radiant has its own set of magic entries that it looks for in order to accomplish linking between layouts, snippets and page content. These take the form of XML elements. Some of these form containers and some form attributes (for example, one attribute could be a page’s title). Many of the containers define the object to which an attribute applies – for example, you might want the title for the current page, a child, or its parent.

These tags apply for all of layouts, pages and snippets and are described in detail later.


Version 10 (current) | Other versions: « older versions
Page last edited by rossetto on July 12, 2007 11:51 AM (diff)