6 Mar

Upcoming Feature: Default Content

March 6th, 2007 — 3:51 pm Dave

With the release of v0.3.2 of slate right around the corner we wanted to give our users a sneak-peek at what they can expect in the next release. So to start us off we’re going to be looking at one of my most anticipated features for slate: default content.

Because of our guidelines for developing web sites we are required to include a group’s address and other sundry information on every page of a site. In the current set-up of slate if we opened up an address as an editable region a user would need to add that content to every page that they create. Also, if the content went out of date they’d have to edit every page with the new content. Because of this we have that information hardcoded in our templates. If a group moves or has a contact change we are on the hook for getting that updated in the theme. As always we want to get out of the way and give our users reasonable control over their content. In steps default content.

The default content feature in slate gives the user the ability to define, for any editable region, default content that will be automatically displayed across their templates. Here’s how the process works from the user’s standpoint:

  1. You create your home page using your index template. It has an editable region with the key ‘address’ (see the previous posts on themes)
  2. You edit, save, and publish the content for the address editable region.
  3. Looking at the home page in editor view you’ll have your normal yellow boxed editable regions. But now you have an extra option in the toolbar for each each region. A little heart with a plus sign.
  4. Clicking the heart icon sets the content you have in the address editable region as the default for all regions defined by the key ‘address’. This includes across other templates. For example, you have a back page template with a region called address.

Pretty straightforward. Editing the content for that region will update and edit content for all the other pages that have the address editable region.

Ah, but you want to have an address on one page be slightly different then all the other pages. We give you an out where you can override the default content for an area with content just for that one page. It only works on a page-by-page basis.

To me the solution is really clean, elegant, and flexible. I had originally thought that we would implement something like Library Items in Dreamweaver but, as Chris will point out, it’s awkward to take the concept of adding, editing and managing content out of the page you’re trying to edit. If you want to edit content on a page you’re going to want to edit a page… not jump to some weird component just in the case of default content. The other solution that could be proposed would be a DB-based address field. To me that takes away any kind of flexibility and power you can get from the system. And maybe we want to style an address differently between sites.

Once you use it you’ll realize that it really makes sense to implement the concept in the manner Chris did. We hope you find this new feature useful.

Add comment

You are adding a new comment