What should I look at when I extend Carousel component? I'm having confusion while extending the html part. | Community
Skip to main content
Adobe Employee
September 7, 2022

What should I look at when I extend Carousel component? I'm having confusion while extending the html part.

  • September 7, 2022
  • 1 reply
  • 629 views

What should I look at when I extend Carousel component? I'm having confusion while extending the html part.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

Anmol_Bhardwaj
Community Advisor
Community Advisor
September 7, 2022

Hi @con84758 ,

 

The best approach to re-use a component (OOTB or custom) is to proxy that component.

That means, adding the property 

sling:resourceSuperType = <path_to_component>

to the component.

Now, if you want to extend a html for the same, you cannot extend that in 2 ways:

1. Copy the html file from the original component and make changes. [ Best if you need changes within the file itself, like changing class, removing an element etc. ]

2. Inlcude the original .html file in your new .html file which you will create under the component [ Best if you just need to add something on-top/after the already rendering content from the html, like adding another div at the bottom, top or etc. ]

 

You cannot delegate sightly the same way we delegate SLING modals, you would need to overlay or extend in some way ( I can just think of these 2 )

con84758Adobe EmployeeAuthor
Adobe Employee
September 7, 2022

Exactly, I've created a proxy component by defining the superesourcetype . Also extended the dialog by copying it from ootb carousel. But while creating the html, I've a markup which is totally different from what we have in the ootb.