3

I've created my own custom experience button to edit some responsive images for a logo in my header and I added the button to the rendering. It works as expected and I am not having any problems with it.

However, I would like to move the button to an edit frame using Glass Mapper's BeginEditFrame so that the content manager can just click on some placeholder text to access the custom button.

I'm trying to use the edit frame with this signature - BeginEditFrame(string buttons, string dataSource, string title).

My code is as follows:

using (BeginEditFrame("{CDA69877-442C-47CC-87D3-E1D2BF61E5B8}", "{6F455DBC-29FE-40FC-9803-0A738677EC04}", "Logo Images"))
{
    <p>Click here to edit the logo.</p>
}

The first Guid represents the ID of my custom button. The second Guid represents the datasource item containing my logo images.

I also tried using the filepaths instead of Guids but got the same results.

In case it helps, my button is found at /sitecore/content/Applications/WebEdit/Custom Experience Buttons/Responsive Images

And my datasource item is at /sitecore/content/siteroot/Data/Headers/Header

I don't get any errors with this code, but the edit frame that pops up does not have anything useful. I've pasted it below.

Edit Frame Pop-up

  1. Am I correct in using my custom button filepath/Guid for the buttons parameter? (Edit: I just figured this part out. I needed to use the filepath/Guid for the folder containing the buttons and not the filepath/Guid for the button item itself.)

  2. And is the datasource item that holds the logos in question the datasource parameter that the method signature is asking for?

1

I figured it out.

  1. For the buttons parameter, I needed to use the filepath/Guid for the folder continaing the buttons I want to be displayed on the edit frame.

  2. This worked when I used the Guid of the datasource item containing my logo images, which is what I thought it should be. I'm not sure why it didn't work initially.

| improve this answer | |

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.