Why do we need to inherit parbase component for all image rendering components in AEM? What are the other alternatives?
Solved! Go to Solution.
Views
Replies
Total Likes
Hi
Adding to what Scott has mentioned,
//
Parbase is just a component from which you extend to get some OOTB functionality.
If I can say in technical language, Parbase is a key component as it allows components to inherit attributes from other components, similar to subclasses in object oriented languages such as Java.
For example, when you open the /libs/foundation/components/text node in the CRX Explorer, you see that it has a property named sling:resourceSuperType, which references the parbase component. The parbase here defines tree scripts to render images, titles, and so on, so that all components subclassed from this parbase can use this script.
While creating your own components, you don't need to add 'parbase' as a supertype, unless your components need to be enabled with drag-drop in a parsys.
AFAIK, the parbase component is never used explicitly, but only facilitates the rendering of a component when added in the Parsys.
"The parbase allows components to inherit attributes from other components"
If you check under "/libs/foundation/components", most of the authorable and draggable components have 'parbase' set as their 'sling:resourceSuperType' so that they can inherit the image and text rendering properties when added to a Paragraph system (Parsys Component).
Documentation link:- https://docs.adobe.com/docs/en/cq/5-6-1/wcm/default_components/designmode.html#parbase
I hope this helps.
Thanks and Regards
Kautuk Sahni
Views
Replies
Total Likes
The parbase allows components to inherit attributes from other components
If you do not want to inherit from other components - you can build your own image rendering component. For example - using a JQuery plug-in:
https://plugins.jquery.com/tag/image/
You can build it so it does not inherit from other components.
Views
Replies
Total Likes
Hi
Adding to what Scott has mentioned,
//
Parbase is just a component from which you extend to get some OOTB functionality.
If I can say in technical language, Parbase is a key component as it allows components to inherit attributes from other components, similar to subclasses in object oriented languages such as Java.
For example, when you open the /libs/foundation/components/text node in the CRX Explorer, you see that it has a property named sling:resourceSuperType, which references the parbase component. The parbase here defines tree scripts to render images, titles, and so on, so that all components subclassed from this parbase can use this script.
While creating your own components, you don't need to add 'parbase' as a supertype, unless your components need to be enabled with drag-drop in a parsys.
AFAIK, the parbase component is never used explicitly, but only facilitates the rendering of a component when added in the Parsys.
"The parbase allows components to inherit attributes from other components"
If you check under "/libs/foundation/components", most of the authorable and draggable components have 'parbase' set as their 'sling:resourceSuperType' so that they can inherit the image and text rendering properties when added to a Paragraph system (Parsys Component).
Documentation link:- https://docs.adobe.com/docs/en/cq/5-6-1/wcm/default_components/designmode.html#parbase
I hope this helps.
Thanks and Regards
Kautuk Sahni
Views
Replies
Total Likes
Views
Likes
Replies