Expand my Community achievements bar.

How can one add items by duplicating the item type in an accordion

Avatar

Level 2

Hello,

 

I would like to know if it's possible when working with an accordion to simply copy the previous item and component type. For some context I have multiple FAQ sections with numerous items in each accordion. For example. I need to have 20 items. Each item is a text component. I'm currently having to add each item one by one. This is very time consuming. Is this possible?

 

I've added an attachment of what I'm thinking. 

 

Thank you!

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Reply

Avatar

Community Advisor

Hi @Edardna,

Unfortunately, AEM does not provide a built-in “duplicate accordion item” feature inside multifields or component dialogs. Each item must be added manually through the dialog because Granite UI multifields don’t support copy/clone operations by default.

However, there are a few practical solutions depending on how your project is set up:

1. Use a Composite Multifield (Recommended)

If your accordion is using a composite multifield, authors can:

  • Click the wrench icon on an item

  • Select Copy

  • Then Paste another item inside the same multifield

This only works if your component uses the modern composite multifield pattern:

<sling:resourceType="granite/ui/components/coral/foundation/form/multifield"
 composite="{Boolean}true"/>

If your accordion is still using the older multifield implementation, copy/paste is not available.

2. Enable Paste JSON in Multifield

You can add a small customization that adds:

  • Copy JSON of the selected item

  • Paste JSON to create a clone

This is done by adding a custom clientlib that listens for foundation-contentloaded and enhances the multifield.
It’s a common pattern used in many implementations.

3. Use CRXDE to Duplicate Nodes (Fastest for Authors)

If authors are comfortable with CRXDE or the Content Tree:

  1. Navigate to the accordion component node

  2. Expand items

  3. Right-click any item -> Copy

  4. Right-click parent items -> Paste

  5. Rename the item if needed

  6. Refresh the page editor

This instantly duplicates the entire structure including fields.

4. Add a Custom “Duplicate Item” Button (Custom Development)

If you want the exact button you showed in your mock-up, developers can add:

  • a custom Coral action button inside each multifield item

  • a JS handler that clones that item’s HTML, updates IDs, and inserts it as a new entry

  • A Sling model that persists it into the JCR

This is fully achievable but requires custom UI development.

What is NOT possible

  • AEM does not allow right-click duplicate or auto-replication of authoring dialogs out-of-the-box.

  • Core Components accordion does not include item duplication.


Santosh Sai

AEM BlogsLinkedIn