Search code examples
sitecorecustom-controlscontent-editorsitecore8.1experience-editor

Sitecore 8.1 - 'Add' button to custom field type and Experience Editor


Question that covers both the Experience (Page) Editor and the Content Editor.

I have a Timeline spotlight that users can add to a page - it has a list of decades at the top and underneath each decade there is a list of Years (with their text and images).

I have created a number of controls that link to various data sources but I'm finding the user experience lacking.

If I go to the Experience Editor:

  1. Select Timeline Placeholder and Add Item
  2. Popup comes up to select/create the data source

Then the only way to add a decade is by going to the Decade datasource, creating a new item there and then going back to the Timeline data source and adding this item their.

What I'm thinking of is:

  • Content Editor - Against the Timeline data item their is a multi-list field of 'Decades' - is there any easy way to add a 'Create' button next to it that would replicate the same event as if you went to the Decades data source and clicked insert item
  • Experience Editor - Remove the use of the Placeholder and add a similar 'Create' button that will replicate the insert item event - once item created and properties set refresh the control to display according.

Anyone came across something similar before? Any better solutions?

Thanks, Dan


Solution

  • Got an answer from the Sitecore Community that might be helpful -

    In experience editor you can create an edit frame button and use it for your rendering... from what i can see, your rendering data source points at "decades" folder. inside your rendering, check if you are in page editor and use a custom edit frame to display custom buttons. one of those will be an insert button to allow you to create a new child under "decades".

    Full details in this blog post re Experience Editor Edit Frame Button.