Any Example of reusing one component A to make 90% identical component B ----> Most preferrally how we can do by using sling script resolution scheme ?
Solved! Go to Solution.
Views
Replies
Total Likes
Make Component A as parent(sling:resourecSuperType) to Component B.
Make Component A as parent(sling:resourecSuperType) to Component B.
Views
Replies
Total Likes
If you want to reuse the markup between components.
component-a.html
<div>
...
<sly data-sly-include="reuse.html"/> (or)
<sly data-sly-include="reuse.selector.html"/>
...
</div>
component-a
component-a.html
reuse.html
component-b (sling:resourceSuperType: component-a)
reuse.html
include reuse.html in both component-a.html and component-b.html
Views
Replies
Total Likes
Its same as we inherit any core component, so to reuse something u need to inherit the component and add the changes required for that component.
Views
Replies
Total Likes
You can do this via AEM's component building concept, overlay. An example is what you asked, there's an old but effect video from youtube where you can see learn how to create an overlay component, https://www.youtube.com/watch?v=jmzLzvtCSWY&ab_channel=AEMandDevopsTutorial
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies