One thing we got wrong in our first iteration was to put an Edit Frame over pretty much everything. While this is initially tempting – it gives the illusion of everything being editable – it is, still a bad practice if you do not use the Sitecore 6.4 Page Editor commands properly.
Basically, when our developers learned about Edit Frame, we had the Edit Frame around just about every module, meaning that the authors needed to click the North-West arrow every time to edit the module..
This best practice describes why that approach is no longer necessary .
- edit module properties (e.g. select the item the module displays)
- edit the displayed item
- publish the item within the module
Adding a new module to a page should present a datasource selection dialog if a module is indeed just displaying an item from a data source.
How do I implement it in my project?You will find a sample actions needed to ascertain how to add a button to your module based on your custom functionality.
One-time project configurationAdding a Publish button: 1. In App_Config/Commands.config, add the following line: 2. Open database core in Content Editor, navigate to node /sitecore/content/Applications/WebEdit/Custom Experience Buttons. Add a new button using template /sitecore/templates/System/WebEdit/WebEdit Button. Under Data heading, set Header to "Publish", Icon to "network/32x32/earth2.png", Click to "webedit:publishrelateditem" and Tooltip to "Publish Related Item". Publish your changes.
2. Add a Publish button to you template if it uses Datasource to refer to an external item. Those settings are available under Editor Options heading when you open you Template in Content Editor.
- <sc:FieldFieldRenderer> The last one, FieldRenderer, automatically adjusts to the type of the field it is pointing to. Each of those controls require setting the Field property and either DataSource (accepts item path) or Item (accepts and Sitecore API Item). By default, controls derived from BaseUserControl will setup DataSource automatically.