Tuesday, April 11, 2017

Sitecore EditFrame in MVC

Hi All,
Today we discuss about Editframe in sitecore MVC.
This is use for edit the associated fields value by providing content editor look to experience editor user. Like there are many fields which are not easily edit in experience mode for that we can use editframe.
Steps are below:
1. Navigate to code db "/sitecore/content/Applications/WebEdit/Edit Frame Buttons"
2. Under this node create a seprate directory for you project like "DemoProject"
3. Right click and insert "Field Editor Button" as below:

This button create from "/sitecore/templates/System/WebEdit/Field Editor Button" template.
Give a suitable name to button like "CustomTextEdit".
4.Fill the Name in "Header", choose icon in "Icon" and in "Tooltip" type description which you want that come in hover.
5. In "Fields - pipe-separated list of field names to be edited by the Field Editor [shared]:" Place the name of fields which you want to edit like:
ex: Title
ex: Title|Description   etc.
6.Now in code use editframe as below:

@using (Html.BeginEditFrame(Html.Sitecore().CurrentRendering.DataSource, "//sitecore/content/Applications/WebEdit/Edit Frame Buttons/DemoProject"))


If you don't wanna use above method then there is alternative as well:
1. Navigate to in core db "/sitecore/content/Applications/WebEdit/Custom Experience Buttons"
2. Insert a field editor item based on "/sitecore/templates/System/WebEdit/Field Editor Button" button
3. Same as above in "Fields" fill the field name as below:
ex: Title

ex: Title|Description   etc.
4. now come in master db and found the rendering for which you wanna this editframe.
5. On specific rendering under "Experience Editor Buttons" select your custom button.


I hope you enjoy this Sitecore blog. Stay tuned for more Sitecore related articles.

Till that happy Sitecoring :)

Please leave your comments or share this article if it’s useful for you.

No comments:

Post a Comment