Sitecore 7.1 included the release of SPEAK, a technology that greatly simplifies the process of creating user interfaces for use inside the Sitecore client. But Sitecore partners and customers don't upgrade their servers immediately. In fact, Sitecore still has a good number of customers running Sitecore 6 who have no plans to upgrade in the near future.
So if you're building a module for Sitecore, Sheer UI is still something to consider, especially if you want your module to be compatible with earlier versions of Sitecore. This post describes how to add the ribbon to a Sheer UI application.
The first step is to define an application.
The ribbon will contain a single chunk with a single button.
The XAML file must be in a location where Sitecore can locate it. The paths where Sitecore looks for XAML files is defined in web.config under /configuration/sitecore/controlSources.
NOTE: For simplicity I am going to add my file to one of the paths that are already defined in web.config. For a real module you should create a custom config file and define a custom path for your XAML files.
"This text will be replaced when the button is clicked."
A class is needed to load the ribbon and to contain the logic that runs when the button in the ribbon is clicked.
SampleDialog : BaseForm
//defines the location of the item in the core database that represents the ribbon
//corresponds to the literal defined in the XAML file
//corresponds to the border defined in the XAML file
//instantiates the ribbon and adds it to the page
var child =
var item = Sitecore.Context.Database.GetItem(RIBBON_PATH);
child.CommandContext.RibbonSourceUri = item.Uri;
// This method is called when the button in the ribbon is clicked.
// The method is specified in the Sitecore item in the core
// database that represents the button.
.Literal.Text = DateTime.Now.ToString();
Adding a shortcut to the Sitecore Desktop start menu makes it possible for users to access the application.
A new icon appears in the start menu under All Applications.
The dialog displays the button defined in the core database. Clicking the button changes the text in the middle of the page.