Page Management and Publishing

Orchard includes the ability to create CMS pages and associated properties (title, URL/slug, etc) and a management UI for editing, viewing and publishing and them.

User Experience Walkthrough

The following mockups outline the page management and publishing functionality in Orchard.
1. Sign in
Step 1
2. Sign in 2
Step 2
3. Add a page
Step 3
4. Choose a template
Step 4
5. Edit page
Step 5
6. Save draft
Step 6
7. Edit draft
Step 7
8. Change template
Step 8
9. Change template 2
Step 9
10. Orphaned contents
Step 10
11. Manage pages
Step 11

Implementation Notes

This section describes some of the details of the page publishing feature as it is currently implemented, along with pointers to related documents.
Page Creation
The page draft is created in the database when the save or preview button is clicked (preview saves the draft implicitly). In order to save, the state of the page form must be valid.
Save Buttion Defaults
Published Draft Timer Save button defaults to...
Yes No No Publish Now
No Yes Yes Publish Later
No Yes No Save Draft
Yes Yes Yes Publish Later
Yes Yes No Save Draft
No No No Save Draft

Validation Rules
  • A slug can’t be empty. The slug that we store in the database should never be empty, but the user is allowed to not enter a slug. In that case, we generate one for him.
  • A slug can’t be more than (some arbitrariness here) 1000 characters, which allows for some reasonable additions such as /json or the first parts of the url without a great risk of hitting IE’s 2048 char limit for the URL. Message: “Please keep the slug under a thousand characters.”
  • A slug can’t have international characters (at least for now). The range of allowed characters is a-zA-Z0-9$-_.+!*’(),/ (see RFC 1738). Message: “Please use only alphanumeric characters (no accents or characters not in the Latin alphabet) and the characters $ - _ . + ! * ' ( ) and /. No spaces are allowed (please use dashes or underscores instead).”
  • The title field cannot be empty. Message: "Please specify a title."
  • The title field can contain any character except for tabs, newlines/CR and control characters. Message: "No control characters are allowed in the title field."
  • If the radio button for later publication is checked, a date must be specified. Message: "Please specify a publication date."
  • If a publication date is specified, it must be parsable under the current culture. Message: "'{0}' is not recognized as a valid date. An example of a valid date is: '{1}'." Substitute {1} with the current date, formatted with the current culture.
  • The publication date, if specified, must be in the future. "Please specify a future date."
Orphaned Contents
When the user switches the page to a layout that has less zones than the previous ones, he is potentially creating orphaned contents. We don’t throw that contents away or try to merge them. We also don’t try to reassign if the zone names are different, even if the number of zones is the same.

Instead, we display the following message in the top alert zone: “You have switched to a template that does not have the same content zones as the previous one, resulting in some of your contents not showing up on your site. You can either delete that content or copy it into another zone.”

In the admin screen for the page, we show the orphaned contents with an alert “This content is assigned to a zone that does not exist in the current template. Please delete it or copy it to another zone.”

When the page is saved, we delete empty orphaned contents. By empty, we mean empty of contents, not necessarily empty string: <p></p> is empty contents. Warning, <img src=”foo.gif”/> is not.
Changing Templates
The behavior when clicking the change template button is to be determined. We could warn about unsaved changes when JS is enabled, or we could implicitly save, or we could persist the data in hidden fields.
Page Management
We are not implementing parent pages. In future iterations, we’ll introduce ways to organize pages and other kinds of contents using tags and / or categories.
Security
We do not introduce security in the iteration as this would require making a decision on user management / membership, which we are not ready to do at this point. It should be a high priority item for future iterations.
Media Management
Media management is described in this page: media.
History / Revisions
We do not implement history now but so that we do not have to throw away our implementation of drafts when we do, we implement the draft feature now with history in mind. In particular, the database structure will be the one that we’ll eventually use for storing revisions. A draft is a special case of revision.
Error information bar
Error messages and warnings in the admin UI are uniformly presented in a colored bar that sits between the title area and the top of the current screen. The bar takes all the width of the page.

Errors are on a red background, warnings on an orange background, informational / confirmation messages are on a cream background.

The messages have an optional icon, a type (error / warning / notification) and a text message. They are informational and may state possible action steps for the user, but they do not contain any UI (confirmation or otherwise) other than the icon and message.

The bar is temporary and disappears as soon as any user action results in a POST or an Ajax request.

The bar is able to expand to display more than one message at a time, stacked one above another.

The validation summary when it exists goes into the error bar.

The admin views will have to provide a hook for the message bar to display.
Dialogs
Some user actions will result in the system prompting him for additional information. One such example is bulk delayed publishing, where we need to prompt for the publication date.

In the non-JavaScript case, this is done by displaying the dialog UI as a separate screen.

When JavaScript is enabled, the same dialog will be shown as a lightbox modal dialog style without navigating away from the current page.

Dialogs have a cancel button.

Last edited Nov 10, 2009 at 11:39 AM by bradmi, version 5