we have a problem here with wrapping components on AEM 6.4 SP2: Let's say I want to extend the wcm core image component (v2) and create my own wrapper component to extend the feature set.
The wrapper component has it's own html, and sets the resourceSuperType. Additionally there is a cq:editConfig (with a drop target with this component's resourceType), cq:dialog and a cq:design_dialog (one option added in the component configuration). Now my wrapper component is versioned as well, since it is part of a platform project that is used by many other projects. Therefore, the component group is ".hidden".
Additionally there is at least one project specific component ("extendedImageWrapper") that is wrapping my component ("extendedImage"). extendedImageWrapper is empty, it just has a resourceSuperType set, referencing extendedImage.
extendedImageWrapper is allowed to be used in an editable template. There is a policy for the component in the given layout container.
Everything is working fine as long as I do not use the drop target. If you drag&drop an image in the drop target, then the resource type is overwritten and referencing "extendedImage" and not "extendedImageWrapper" any more. For extendedImage there is no policy available as it is not allowed to be used in the given template. Therefore currentStyle in the SlingModel for extendedImage is empty.
If I fix the resource type with crx/de, things are working again...
My question now: What is the best way to wrap a (configurable) wrapper component with a drop target? Creating a edit config for the wrapper is an option, but that feels wrong. Any ideas?
BR, Oliver
Sometimes it helps just to write things down.. the solution is: Simply do not set a resource type for the drop target...