Sitecore Content Editor Tabs In SPEAK
Within the Sitecore Content Editor, the editor section can change context based on the type of Item you are editing. For example when a media folder item is selected, the view allows you to upload media files, a template item allow you to add fields etc. These areas are called editors.
You can define and create your own custom editors within the Content Editor and specify the type of items it is applicable to.
Creating the Editor
To create the logic for the custom editor you can either create a single page SPEAK application or a ASPX page or similar. The single page application is then Iframed into the Content Editor by Sitecore.
As the custom editor will be displayed when you have chosen a Sitecore Item, you will want to know the context item that has been selected. Sitecore handles this for you, The Item id, context database, language and version number are passed to your Editor application as query string parameters.
Query String Parameters
For example this code allows to trigger a new tab from within a Editor Iframe
Editors are defined within the Core database within the following folder"/sitecore/content/Applications/Content Editor/Editors". Here we can create additional editor definitions, its recommended practice to create a new folder to hold your custom editors not to clash with Sitecore in future upgrades.
A Editor item is made up of a few fields:
- Header: This is the text thats displayed in the tab in the UI
- Icon: Doesn't appear to be used.
- Url: This is the URL of the application you want to Iframe as a Editor. This can be a SPEAK application, ASPX file or similar. For a SPEAK application in the following location in the Core database "/sitecore/client/Robbins/Tabs/AdvancedUserTab" the URL would be the same "/sitecore/client/Robbins/Tabs/AdvancedUserTab"
- Refresh On Show: This checkbox causes the Iframed page to be refreshed every time its tab is selected.
Custom Editor Definition
Applying A Custom Tab
The last step is to apply the Editor to the required item templates that will display the custom Editor.
Within the standard values of the template(s) you want to add the Editor too, update the Editors field within the Appearance tab to add in your custom editor.
Add Custom Editor
Whenever you select an item of this template type the Custom Editor will be loaded and displayed. As this is a Sitecore Item in the Core database you can also add security to lock access to the custom Editor if required.
Custom Editor Item Editting