Settings

Settings are key/value pairs that augment the data for a website, page or post. They can be used in several useful ways:

  • To add site-level data that doesn't have a proper home elsewhere (for example, Google Analytics code)
  • To create multiple asset sizes for images uploaded to a site or page
  • To add fields ('default settings') to posts in the blueprints that use a page-with-posts model (like News, Blog, Personnel, Projects and Gallery)

For database optimisation reasons, they should be used sparingly (for example, if you find yourself using default settings to add several fields to a blueprint, you should think about developing a custom blueprint instead.

Referring to settings in your templates is easy:

<%= @site.settings("Analytics") %>
<%= @post.settings("Excerpt") %>
<%= @page.settings("Intro") %>

Site settings

Site settings can be created using the site editing dialog within the browser (or via script/console if you're feeling brave).

settings

Once created, site settings can be edited from the 'settings' tab in the Blueprint admin interface.

settings_admin

Default settings

Default settings can be used to add new fields to posts within page-with-post blueprints. For example, if you want all news posts to have a field for an excerpt (to display in the archive perhaps), you can add an "Excerpt" default setting to the News page.

Default settings can be configured as text fields, textareas, select menus or checkboxes, so that you can demand a particular type of data from your users.

defaultsettings

Page settings

Page settings are useful for all kinds of page-specific data. For example, you could use a page setting to add a new content field for a page ("Intro", "Excerpt") that you can then display in your template.

User notes

(You can add notes to this page using the form below.)

Laurence Barnes [Wed 29 Jul 2009, 2:05PM]

To display HTML / blueprint syntax within a setting, you need to use the bluedown feature. This will also publish the text in paragraphs etc...

For example: <%= bluedown(@page.settings["Intro"]) %>


Only the note field is required.

Preview or