Global Office Directory
More Products
Share this page
Home > Community > Technical Blogs > John West Sitecore Blog > Sitecore CMS 6.4: Page Editor Commands
This blog post describes how you can add commands to placeholders, renderings, fields, and markup elements in the Page Editor using version 6.4 of Sitecore's ASP.NET CMS. For more information about Sitecore CMS 6.4, see my previous blog post, Sitecore CMS 6.4 Features.
You can add commands to the user interface components that appear in the Page Editor when the user selects a markup element, field, rendering, or placeholder.
To add a command for a markup element in the Page Editor, such as an embedded video, you can use an edit frame as described previously in the Client Configuration Cookbook. You can use an edit frame around one or more elements, including any number of fields.
Tip: Avoid edit frames in favor of rendering commands.
To define a new command for a field, rendering, or placeholder, in the Visual Studio project, create a class that inherits from the Sitecore.Shell.Applications.WebEdit.Commands.WebEditCommand class. Create a corresponding entry to the /App_Config/commands.config file. Under the /Sitecore/Content/Applications/WebEdit/Custom Experience Buttons item in the Core database, add a button definition item using the System/WebEdit/WebEdit Button data template.
To add commands for an individual field in the Page Editor, in the Content Editor or the Template Manager, select buttons in the Page Editor Buttons field in the Data section of the field definition item.
To add commands for all fields of a specific type in the Page Editor, in the Content Editor, under the field type definition item in the Core database, in a folder named WebEdit Buttons, insert an item using the System/WebEdit/WebEdit button data template.
To add commands for all fields in the Page Editor, in the Content Editor, under the /Sitecore/Content/Applications/WebEdit/Common Field Buttons item in the core database, add a button definition item using the System/WebEdit/WebEdit Button data template.
To add commands for all renderings in the Page Editor, under the /Sitecore/Content/Applications/WebEdit/Default Rendering Buttons item in the Core database, add one or more button definition item using the System/WebEdit/WebEdit Button data template.
To add commands for an individual rendering in the Page Editor, select buttons in the Page Editor Buttons field in the Editor Options section of the rendering definition item, or in the rendering properties of layout details.
To add commands for all placeholders in the Page Editor, under the /Sitecore/Content/Applications/WebEdit/Default Placeholder Buttons item in the Core database, add button definition items using the System/WebEdit/WebEdit Button data template.
The getChromeData pipeline defined in the web.config file contains processors that determine which commands to expose for each edit frame, field, rendering, and placeholder displayed in the Page Editor.
My prototype for a field command resets a field to its standard value. It seemed almost too easy.
Tags: API, Architecture, Infrastructure
- Che Guevara October 14, 2010 at 9:13 AM
- Jukka-Pekka Keisala October 15, 2010 at 4:01 AM
- John West October 18, 2010 at 9:44 AM
- David Stöger June 30, 2011 at 1:15 AM
- Andrei Kiss August 16, 2011 at 10:25 AM
- John West August 17, 2011 at 8:36 AM
John has over ten years of experience in the CMS industry. His areas of focus include the Sitecore community, Web industry research, Sitecore technical documentation, and product management.
This website is designed to be fully functional with scripts disabled in browser. Please contact the webmaster for any suggestions