Tag Archives: Sitecore Rocks

Sitecore 8 adding edit meta data button in experience editor

Are you still making your content author to edit the content of a page using content editor? then stop.

For content author in Sitecore the best way for them to edit a page is to use Sitecore Experience Editor. This way they can focus on editing the content on the page with visual indication what would their changes would look like. However there are some cases where content can’t be edited on the page because they are not displayed on the page itself, Metadata information is such a case.

There are some guide already out there to set up an edit meta data button in page editor in Sitecore 7 and below, and here I would like to do the same in Sitecore 8. This is based on the guide that I’ve found on http://blog.istern.dk/2015/03/02/running-sitecore-field-editor-from-a-speak-command-in-sitecore-experience-editor/ which can be reused to create other type of functionality.

First you need to install Sitecore Rocks, because in Sitecore 8 the interface is built using SpeakUI you may find it quite different with how you usually set up a new button in Sitecore 7 and below. I’ve also found it easier to create a SpeakUI component using Sitecore Rocks, so you definitely should check it out. After you’ve installed Sitecore Rocks and setup a connection to the Sitecore website you should see the following screen.



Expand the core database and go to sitecore->content->applications->webedit->ribbons->webedit

Here you can see a couple of familiar strips which is what being displayed on the experience editor



We want to add a new button to edit meta data here, so go in Sitecore Rocks and under the WebEdit node follow this steps

  • Add a new Page Properties strip
    • Add a new item with the template of Strip.
    • Set the header to “Page Properties” and the ID to “PagePropertiesStrip”
    • In Sitecore Rocks select tasks and design layout then add a new rendering of type Strip
  • Add a new Hidden Content chunk
    • Under the new Page Properties strip add a new item with the template of Chunk
    • Set the header to “Hidden Content” and ID to “HiddenContentChunk”
    • In Sitecore Rocks select tasks and design layout then add a new rendering of type Chunk
  • Add a new Edit Meta data button
    • Under the new Hidden Content chunk
    • Set the header to “Edit Meta Data” and ID to “EditMetaDataButton”
    • In Sitecore Rocks select tasks and design layout then add a new rendering of type LargeButton
    • Edit the rendering properties of the LargeButton
      • Set AccessKey to Meta Keywords|Meta Description (this the meta data fields that I’ve setup in Sitecore)
      • Set the Click property to trigger:button:click
      • Set the Command to LaunchFieldEditor
      • Set the PageCodeScriptFileName to the path of the LaunchFieldEditor.js file is


What it currently looks like so far



At this stage we still need to register the command to handle the edit meta data button functionality so let’s go ahead and do that.

The GenerateFieldEditorUrl class

The LaunchFieldEditor.js

update: if you’re using 8.1 + then the js code needs to be modified slightly – feedback from Yoki in the comments (and tested in 8.2u1)


After all have been setup correctly the content author can now edit the meta data button through the experience editor.