1

I have a component that is a list of content managed links, and I'm trying to figure out what the best way is to make this experience editor friendly.

Currently the component has a "list" datasource, where you enter individual links as child items. Without getting super crazy with it, this is probably the design I'm going to have to go with, but while it's perfectly logical in the Content Editor, it doesn't work in the Experience Editor at all.

I think ideally what I would like to do is be able to present the user with a way to open the content editor as a modal, on top of the experience editor. I currently have a button that opens a new tab to the content editor with the root item set to the list datasource. This is functional, but it's not ideal. I'd like to be able to open this window as a modal, so they can easily update the list without having to leave the page entirely.

Is this possible? I know I've done something similar within custom speak pages, using the modal components, but I'm not sure how I would accomplish this within the experience editor.

BTW, we are on Sitecore 9, update 1.

2
  • You may want to look at the custom experience button. You can add this to experience editor frame when a user selects the component and can easily pop up specified fields to edit in a dialog. Commented Sep 2, 2018 at 3:01
  • 1
    youtube.com/watch?v=D6jqqaBMu0s (video on adding experience editor buttons)
    – Gatogordo
    Commented Sep 2, 2018 at 9:19

2 Answers 2

2

Possible solutions can be found in the below article. It has almost the exact same example as in your case.

https://www.singlestoneconsulting.com/-/media/files/sitecore_experience_editor_enhancements.pdf?la=en

Required functionality is achievable by Custom Experience Button quite easily but there is a problem in this approach where

component has a "list" datasource, where you enter individual links as child items.

While being on Experience Editor, Author makes the changes in the ChildItems (links in your case) of the data-source given in the rendering parameters and publish it but the changes wouldn't reflect in the web database as Sitecore will publish the current page and related items. But it won't publish the child items of the data-source though it will publish the data-source item. Hence the changes will not appear in the web db.

Above problem can be fixed in three ways.

  • Make page level data-sources where the component on the page will select the child as data-source. While publishing the page just make sure that sub-items checkbox is selected in the publishing popup.
  • Data-source item should have a Multilist/Treelist field where the child items should be select-able. In the code just make sure to pick items from this field to fill the modal instead of getting it as ChildItems from Sitecore API.
  • Modify the Sitecore publishing pipelines to include the child items of the data-sources selected in the renderings.

In such cases, I prefer second approach given above.

1

You can use "Experience Editor Buttons" functionality which replaced previous "Edit Frame".

Follow these steps:

Step 1: SET UP THE AVAILABLE BUTTONS

Go to the CORE database. Find the /sitecore/content/Applications/WebEdit/Custom Experience Buttons.

For your own pleasure, create a nice folder structure that matches your component structure, and add a “Field Editor Button” in the structure:

A Field Editor Button placed in a folder below Custom Experience Buttons.

In the “Fields” field of that button, add the fields that needs to be editable, as a Pipe separated list, like this:

FieldName1|FieldName2|FieldName3

Step 2: CONFIGURE THE RENDERING

In the “Experience Editor Buttons”, add the button you created:

The button is added to the Experience Editor Buttons

Step 3: TEST IT

Now, when clicking the rendering, the button you added is available:

Experience Editor Buttons

And when clicking it, the Edit Frame opens, and the fields are available for editing:

Edit Frame

Steps taken from this awesome article written by Brian Predersen:

More information:

Your Answer

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

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