Resuing the component

Avatar

Avatar

AdobeID24

Avatar

AdobeID24

AdobeID24

28-12-2020

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 ?

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

Anudeep_Garnepudi

MVP

Avatar

Anudeep_Garnepudi

MVP

Anudeep_Garnepudi
MVP

28-12-2020

@AdobeID24 

Make Component A as parent(sling:resourecSuperType) to Component B.

  1. Create Component B
  2. Delete all the resources under Component B (will get 100% inheritance)
  3. Add your override to Component B

Answers (2)

Answers (2)

Avatar

Avatar

BrianKasingli

MVP

Avatar

BrianKasingli

MVP

BrianKasingli
MVP

28-12-2020

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

 

Avatar

Avatar

Ankur_Khare

MVP

Avatar

Ankur_Khare

MVP

Ankur_Khare
MVP

28-12-2020

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.