As I mentioned in my last post in this post we will learn how we can make field editable which are not editable from Experience Editor for example treelist, multilist, checkbox etc.
Sometime we make everything as per the recommended way in experience editor but some of the fields which we can’t edit directly from Experience editor as there is no specific view for them so Sitecore provided a nice way to handle this.
To handle these types of requirements we need to create EditFrames. EditFrames in the Experience Editor is a feature that you can use to give users front-end access to fields that are not directly accessible, either because they are not visible or they are of a type that are not directly front-end editable.
To start with it first identify the field on components which you want to make editable and follow the below steps –
- Go to Core Database and navigate to /sitecore/content/Applications/WebEdit/Edit Frame Buttons location.
- Create a Folder with /sitecore/templates/System/WebEdit/Edit Frame Button Folder folder data template. (On the above given location this folder is already part of insert option)
- Add item with Field Editor Button data template from /sitecore/templates/System/WebEdit/Field Editor Button template location. (This is also part of insert option so you will get suggestion while adding the item.)
- This item has 4 fields as below –
- Header – It is just for to show the name
- Icon – If you want to add any icon to show on Experience Editor you can add here.
- Fields – Pipe-separated list of field names to be edited by the Field Editor.
- Tooltip – If you want to add any.
- After making the updates in Core Db we need to make some updates in our code file (.cshtml) also as below –
We need to Surround the section to show the button with a using block as follows:
// HTML here}
Clicking on the icon will open a modal window with all the fields which we defined in Fields field in step 3rd as below –