adobe / aem-core-wcm-components

Standardized components to build websites with AEM.
https://docs.adobe.com/content/help/en/experience-manager-core-components/using/introduction.html
Apache License 2.0
723 stars 737 forks source link

Added items to Accordion/Carousel/Tabs should always be wrapped with a Container #2780

Open HitmanInWis opened 3 weeks ago

HitmanInWis commented 3 weeks ago

Once a Tab or Accordion Item or Carousel slide is created as something NOT a container, there’s no way to add more items to that Tab/Item/Slide and no way to convert it to a container. Also, there is no way to add a background color/image (container properties).

This, plus the fact that the default Accordion/Tabs extensions in the AEM project maven archetype include a cq:template with 2 items that are both Container when first added to a page, we really should consider having all children of these components be Container. It might also be a boon to FE devs that can now count on all Accordion/Tab/Carousel children to be Container.

HitmanInWis commented 3 weeks ago

I was able to resolve this for my own project by creating a SlingPostProcessor that detects when an Accordion/Tab/Carousel component is having a child added that is not a Container, and converting that component to a Container with a new node beneath it for the created resource.

i.e. Accordion

becomes Accordion

juw177 commented 1 week ago

Not sure how they managed to get the Accordion authoring experience so wrong. The authors just want to see the accordion container where they can drop stuff into. All Accordions should be expanded in Edit mode so authors can easily preview the content.

Right now they have to

  1. Edit the Accordion
  2. Click Add Item
  3. Pick "Container" from a long list of components
  4. Give the item a name (but it is actually the title, not a name)
  5. Click Done to close the dialog
  6. The accordions are all collapsed for some reason. Need to find the hidden "Select Panel" button to reveal that panel (this also collapses all the other panels)
  7. Finally they can edit the accordion content