Snippets

johnmuhl edited this page Aug 24, 2010 · 4 revisions

Snippets are typically small fragments of pages which get reused, but which might not appear on every page. Two different Layouts can then share the same snippet without having to copy and paste between them. You may choose to use snippets even for text that is used on every Page, just to keep your layout as terse as possible.

Snippets are edited from the Snippets tab in the Radiant administrative interface. When you select the New Snippet button you’ll be presented with a form where you can give the snippet a name and some body text. Snippet names may not contain spaces. The body text is relatively straightforward — you can select a filter from the drop-down menu underneath the body text if you want Textile or Markdown support. A snippet should be written in a language appropriate for the content-type asserted by the Layout that includes it, or layout used by a Page that includes it – Textile or Markdown filter use implies the snippet will always be part of an HTML document, though it’s conceivable that you might be serving, say, plain text, and deliberately use the filter as an example of generated markup for part of a wider technical document.

To insert the content of a snippet into a page use the <r:snippet name="snippet_name"/> Radius Tag

Edit Snippet UI

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.