3

I have a rendering that has a Datasource Template of a menu container. When I change the datasource of the rendering, I can create a new Menu Container. But I would also like to add a new menu item to that container via the UI.

I imagine its a custom button in the ribbon of the rendering and a Edit Frame for the item properties? Are there any guidelines I could follow to accomplish this?

2

1 Answer 1

10

There's a straight-forward way to add an Insert button to the Edit Frame of components.

Set Experience Editor Buttons

Sitecore comes with some Custom Experience Buttons which can be added to renderings. To achieve what you want, add the Insert one to your rendering:

Adding Insert button to rendering

When added, you'll see the icon appear in the Edit Frame of the rendering:

Demo of edit frame with insert button

Set the Insert Options

When the Insert button is clicked, it triggers a dialog that allows the user to select a template to insert. The templates that are shown are based on the Insert Options of the datasource template's Standard Values, so you should make sure you add the valid templates there.

1
  • 1
    I'm reminded of the time Neo from the Matrix says "HOLY ___". Very helpful. Thank you. Nov 7, 2019 at 20:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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