1

I need to edit complex sitecore fields in Experience Editor and I am using Glass's BeginEditFrames for that as it only requires change in code.

I am using:

using (BeginEditFrame(Model, "Edit Properties", x => x.Body, x => x.SelectAuthors)) 

This is working fine.

Now the requirement is to change the icon that shows up in edit frame in Experience Editor. I am not sure how can we achieve that.

I have tried the solution mentioned at https://github.com/mikeedwards83/Glass.Mapper/issues/178 but this is not working for me. There doesn't seem to be an override for BeginEditFrame method as mentioned in the post above. I am using Glassmapper v4.5.0.4

Please advice if there is an out of the box way of doing this using GlassMapper.

4

You will see if you look in the core DB that glass creates custom experience editor buttons in the following path when you use BeginEditFrame: /sitecore/content/Applications/WebEdit/Custom Experience Buttons.

Try finding the custom edit buttons that glass has created and changing the icons. In the unlikely event that doesn't work you could create your own folder of custom buttons and point at that. The syntax is:

@using(BeginEditFrame("/sitecore/content/webedit/buttons", Model.Path)){


}

This first parameter can be an ID which is a better approach. The ID or path point to the folder of custom buttons you have created. Each custom button can have an icon defined like any normal sitecore item.

  • Thanks for the info. I didn't realize that Glass creates the EditFrames on it's own in core database. I thought it works without creating items in core database. Found the glass edit frames in the folder /sitecore/content/Applications/WebEdit/Edit Frame Buttons/. Does this mean I have to make a package of these new Edit Frames and install it on my Prod environment? Or will glass create new Edit Frames on Production when the code runs for first time on Prod? – Shaurya Dec 3 '18 at 3:03
  • Although I was not able to get @using(BeginEditFrame("/sitecore/content/webedit/buttons", Model.Path)){ } to work. This is breaking and results in edit frame not showing up on the page. I have tried both path and id. Also have tried path to button folder like in <sc:EditFrames> – Shaurya Dec 3 '18 at 3:26
  • 1
    I would recommend source controlling these items via your preferred serializer (unicorn or tds). With regards to your second question that syntax should work. Otherwise use the sitecore syntax which would be somtething like @using (Html.EditFrame(Model.Id, {insert guid for custom buttons}, "My Buttons", "", "", new { }) – JKerny Dec 3 '18 at 4:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.