Archive for the ‘Sitecore’ Category

Improvements in Sitecore 6: In-page Editing

October 1, 2008

Sitecore offers a choice of different editing interfaces for authors with different organisational requirements and skill levels. Novice content authors can use the basic Page Editor interface which exposes only the functions that they require, whereas site administrators can access advanced tools via the Sitecore Desktop. 

The Page Editor interface is new to Sitecore 6. I have worked with this type of interface on a couple of other platforms and always found it to be a frustrating experience – the interface was often cluttered and the positioning of the editing tools compromised the design (true WYSIWYG editing was difficult to achieve for these reasons). The Page Editor was probably the feature which I was least excited about in version 6, but the guys at Sitecore have produced something which is really fresh and exciting.

The Page Editor provides a simple, intuitive interface for content authoring. Authors edit content within the webpage as if they were a user browsing the website. The author logs on to Sitecore then navigates to the area of the website where they wish to add or edit a page. A single button click switches them to the Page Editor interface. The example screenshot below shows an author making a modification to an existing page (click the thumbnail to view a larger version). I’ve pointed out some interesting aspects of the interface within the screenshot. 

In-page editing in Sitecore 6

In-page editing in Sitecore 6

 Once in Page Editor Mode the author is able to click in any area of the page and immediately begin making changes. Sitecore will ensure that the author is only able to use appropriate formatting features as dictated by the associated page template.

The author is able to save their changes by simply clicking on the ‘Save’ button at the top of their browser. Clicking on the ‘Close’ button will exit editing mode and return the author to the standard view of the website.

The Page Editor is designed to provide the simplest interface possible to the content author. It presents a very clean, unobtrusive interface which allows the author to see their content changes as they will appear in the published version of the website. If the author requires access to advanced features they are able to do so by clicking on the ‘Ribbon’ button at the top of the screen.

The editing ribbon provides access to features beyond simple content authoring. For example, workflow, page naming, validation, and content sorting tasks are all available within the ribbon interface. The ribbon can be hidden again by simply re-clicking the Ribbon button. The screenshot below shows the Page Editor interface with the ribbon displayed.

In-page editing with Ribbon displayed

In-page editing with Ribbon displayed

So, you can see the the Page Editor interface can make the editing experience as simple or complex as the author needs it to be. It is a powerful interface which is going to make web content management accessible to a whole new audience – and I love it!

Sitecore v6 released

July 21, 2008

Sitecore have released version 6 of their web content management platform. I was lucky enough to particpate in the beta programme for the product, and I was impressed with what the new version has to offer.

There is some great stuff in the new version, with additional usability, compliance, and security features to the fore. I’ll be making a few posts about some of my favourite new features over the next few days. In the meantime, check out the press release.

Displaying multiple field validation messages in Sitecore

March 26, 2008

Sitecore supports field-level validation out of the box. This is a good feature and is simple to implement, but the manner in which the validation error messages are presented is not ideal. Essentially, when the user saves a page and the validation fails Sitecore will display a pop-up message with the first failed fields’ validation text. The user will then typically fix that field, save again, and be presented with the next validation error message. Imagine a template with 60 fields, of which 30 are mandatory – getting the validation messages one at a time would be a frustrating experience for the author.

The team here at the office set out to find a more user-friendly way of displaying validation messages. We wanted to present the author with all of the error messages at once, within the Content Editor, so that they could edit the page and work through each failed field in turn. A conversation with Philipp Heltewig (Sitecore Australia) gave us the inspiration – display all of the validation errors within the ribbon at the top of the Content Editor.

  Validation messages

Now that we had the “what”, all we needed to do was figure out the “how”.

Add a Panel to the Content Editor Ribbon

The first step was to create a new tab in the Content Editor ribbon. We called our tab ‘Validation’. You can find full instructions for adding a new tab on the Sitecore website, but here are the high-level steps which we took: 

Within the Core database:
1. Add a new entry to the Default ribbon which references a new strip ‘Validation’.
2. Create the new strip ‘Validation’ which references a new chunk ‘Field Validation’.
3. Create the new chunk ‘Field Validation’.
4. Within chunk ‘Field Validation’ create a new Panel ‘ValidationMessages’. Within ‘Validation Messages’ reference your custom code i.e. “Custom class reference (eg MyCode.Controls.CustomValidationPanel),  Custom dll reference (e.g MyCode.Controls)”

Next, we write the code for MyCode.Controls.CustomValidationPanel

namespace MyCode.Controls
{
    public class CustomValidationPanel : RibbonPanel
    {
        public override void Render(HtmlTextWriter output, Ribbon ribbon, Item button, CommandContext context)
        {
            Item item = context.Items[0];
            if (item != null)
            {
                string mess = ValidateAllFields(item);
                if (!String.IsNullOrEmpty(mess))
                    RibbonPanel.RenderText(output, mess);
            }
        }

        private string ValidateAllFields(Item item)
        {
             string message = string.Empty;
             Item itemCurrent = Context.ContentDatabase.Items[item.ID, item.Language];
             using (new SecurityDisabler())
             {
                 if (((itemCurrent != null) && !itemCurrent.Paths.IsMaster) && !StandardValuesManager.IsStandardValuesHolder(itemCurrent))
                 {
                     foreach (Field field in item.Fields)
                     {
                         Field fieldCurrent = itemCurrent.Fields[field.ID];
                         if (((fieldCurrent != null) && !string.IsNullOrEmpty(fieldCurrent.Validation)) && !Regex.IsMatch(field.Value, fieldCurrent.Validation))
                         {
                             string validationText = fieldCurrent.ValidationText;
                             if (validationText.Length == 0)
                             {
                                 validationText = “‘$Value’ is not a valid value.”;
                             }
                             validationText = Translate.Text(validationText);
                             message += validationText.Replace(“$Value”, field.Value) + “<br />”;
                         }
                     }
                 }
             }
            return message;
        }
    }
}

Put an entry into the Pipeline

Next, update the pipeline for the save event in your Web.config file. The aim here is to override the standard Sitecore client validation message (note ensure that the new entry is above the Sitecore.Pipelines.Save.ValidateFields entry):

<processor mode=”on” type=”Sitecore.Pipelines.Save.ParseXml, Sitecore.Kernel” />
<processor mode=”on” type=” MyCode.Controls.MyItemOnSavingEvents, Namespace. Controls” />
<processor mode=”on” type=”Sitecore.Pipelines.Save.ValidateFields, Sitecore.Kernel” />

Write the code for the Pipeline entry 

Finally, here is the code for our custom pipeline entry:

namespace MyCode.Controls
{
    public class MyItemOnSavingEvents
    {
     #region Process
        public void Process(SaveArgs args)
        {
            foreach (SaveArgs.SaveItem item in args.Items)
            {
                Item curentItem = Context.ContentDatabase.Items[item.ID, item.Language];
                if (((curentItem != null) && !curentItem.Paths.IsMaster) && !StandardValuesManager.IsStandardValuesHolder(curentItem))
                {
                    foreach (SaveArgs.SaveField field in item.Fields)
                    {
                        Field curentField = curentItem.Fields[field.ID];
                        if ((curentField != null && !string.IsNullOrEmpty(curentField.Validation)) && !Regex.IsMatch(field.Value, curentField.Validation))
                        {
                            if (args.HasSheerUI)
                            {
                                Context.ClientPage.ClientResponse.Alert(“Cannot save item. Please check the Validation tab.”);
                                Context.ClientPage.ClientResponse.SetReturnValue(“failed”);
                            }
                            args.Abort();
                            return;
                        }
                    }
                }
            }
        }
        #endregion
    }
}
 

That’s it – we’re done!

There are a few enhancements to this functionality which we want to add in the future, I think that the ability to write each validation message out as a hyperlink to the relevant field would be a great usability feature. Thanks to Rodney Berg here at Datacom for his hard work on this one, and kudos to the Sitecore Support team for their invaluable help during the development.

CMS Watch: MS and Partners not pushing MOSS?

March 3, 2008

From a recent article on CMS Watch (an excellent source of information when evaluting a WCM platform):

“I recently came across two local Danish companies trying to overhaul their web publishing systems. Both had settled on MOSS 2007 for their Web CMS and wanted a proposal for an implementation. Surprisingly, here’s what they got back:

  • In the first project they approached Microsoft directly, which then passed the opportunity onto 2 preferred partners. After a while the local Microsoft office came back and informed the customer that the partners had both declined making a proposal for MOSS 2007 as they did not consider the project a good fit for SharePoint 2007. Instead Microsoft suggested that Microsoft partner Sitecore had more suitable WCM capabilities in this case.
  • What happened in the other project was even more surprising. Here a well-known and considerably large Microsoft system integrator firmly argued for going with the old SharePoint Portal Server 2003 instead of MOSS 2007. They felt much more experienced with the old version, where they could also rely on a range of custom modules to help the project. “

Surprising stuff! Read the full article here: http://www.cmswatch.com/Trends/1163-When-Microsoft-and-partners-don’t-push-MOSS-2007-for-web-content-management

Moving from Microsoft Content Management Server 2002 to Sitecore CMS

February 15, 2008

Several of my clients are currently running websites based on the Microsoft Content Management Server 2002 (MCMS) platform. The majority of these clients are now going through a process of evaluating replacement platforms. When I talk to them about Sitecore they are normally very impressed….but sometimes the terminology used across the two platforms can be confusing.

Over the next couple of weeks I will be publishing some short, high-level postings comparing the ways things were done in the MCMS world with the way in which they are done in the Sitecore world. Hopefully this will make it easier for those considering moving from MCMS to Sitecore to understand the differences between the two platforms.

This first posting will cover reasons why organisations should consider moving away from the MCMS platform.

In talking to our clients I have seen several common themes when they talk about the limitations of MCMS. At a high level, these are:

  1. As a platform, MCMS is not flexible enough to meet ongoing business requirements.
  2. The provided Site Management tools are cumbersome to use.
  3. No new functionality has been added to the platform since 1992 (that is like the last ice age when you consider the rate of change in the Internet space).
  4. Several development issues within MCMS have not been resolved by Microsoft (e.g. creating custom properties on channels via the API).
  5. Microsoft standard support for MCMS ends in April 2009 (although extended support is available).
  6. No more Service Packs for MCMS will be released.

So, there are plenty of solid reasons to move away from MCMS as a WCM platform. But how should an organisation plan the change? What questions should they consider when switching products, and what is the best approach for moving their sites? These are broad questions and fall outside the scope of this article, but my recommendation is to consider this very high-level plan:

  1. Produce a Roadmap of upcoming sites. How many are there, what is their business value, and does it make sense to implement before or after switching WCM platforms?
  2. Also produce a Roadmap for your existing websites. What enhancements are planned? What compromises are being made to extend their life within the current platform?
  3. Undertake a Pilot website using Sitecore (or any other replacement WCM platform).
  4. Plan a migration strategy for your existing websites.

My next post on this subject will focus on the terminology used in MCMS and Sitecore. I will attempt to help you compare apples with apples by producing a side-by-side glossary of the language used by the two opposing marketing machines :-)

Sitecore Xpress

February 5, 2008

Sitecore are about to release a new product aimed at developers who want to learn the platform for free. Called Sitecore Xpress, it is a free download and can be used to create personal websites. It has all of the standard features of the full commercial product.

Check it out here: http://www.sitecoreexpress.net/

This is a great tool for students who want to learn a cutting-edge web content management system, or even for professional development companies who want to see what the platform has to offer without committing to a Partnership agreement.

The only puzzle to me is how the sites built on Xpress will be hosted; I don’t know too many university students that have their own internet hosting environment on which to install the Sitecore engine. Hopefully Sitecore will partner with some shared hosting providers soon so that the sites built on Xpress can be deployed and admired by the masses.

Sitecore Australia opens its doors

February 5, 2008

Great news for the local Sitecore development community – Sitecore Australia have officially opened their doors.

With eleven partners in Australia and increasing interest from the New Zealand market this is an important step for the platform in this part of the world. I’m looking forward to increased local support, more technical resources, and maybe even the odd local road-show or two.

Philipp Helwtig has been tasked with establishing the new company – I’ve worked closely with Phil over the past six months and I am very pleased with his appointment (and I’m not just saying that because he paid for dinner last night!).

New Zealand’s first Sitecore website launched

February 5, 2008

Lots of excitement in the office yesterday as we launched New Zealand’s very first website running on the Sitecore platform. The site was built for the Ministry of Education and was built by ourselves (Datacom) with graphic design and HTML input from ChromeToaster (a great Wellington design shop).

The site has a nice fresh design as it is aimed at the youth market. Later phases will see the site take on an increased Web 2.0 focus with multimedia competitions and more interactive content.

You can check the site out here: www.fuelled4school.co.nz

Where to define the Presentation Layer in Sitecore

January 11, 2008

Recently on a project we ran into a situation where we had defined templates, masters etc and created several content items….and then a late change to the visual design was recieved from the client.

The changes required the addition of a new sub-layout. We built the .ascx and added it to the presentation layers. We then refreshed our browsers, expecting the existing content items to all now include the new page element. Horror of horrors – they all remained the same as they did prior to the new sub-layout being added!

The problem was that we had made a fundamental mistake when deciding where to configure the presentation layer of our content. We had assigned them at the master level rather than on the templates. By using the master’s presentation settings we had effectively declared a static layout configuration. Like all values assigned at the master level, presentation information is statically set on the new content item. Any changes at the template level will not affect these static values.

What we should have done was to define the presentation layer within the Standard Values of each template. Standard Values are dynamic field values which will be applied to all content items (based on the specific template) which have not had static values assigned to those content fields. So, if Standard Values are used to configure the Presentation Layer for a template, and you create many items based on that template, then a design change comes into effect and you change the Presentation settings…….all of the content items based on that template will automatically be assigned the new layout configuration as long as they have not be assigned static values via a manual field entry or a master override.

Sitecore allows developers to set Presentation Layer configuration at either the Template or the Master level – and there may be some cases where you want to assign at the Master level. But the general rule of thumb is “never assign presentation settings at the Master level!”.