How to customize components without overlaying same components in libs layer? | Community
Skip to main content
GK-007
New Participant
October 16, 2015
Solved

How to customize components without overlaying same components in libs layer?

  • October 16, 2015
  • 4 replies
  • 1021 views

Hi All,

We are need to customize DAM admin menu where we need to add new menu items to "New" menu.For this we need to move files under /libs/cq/ui layer /apps/cq/ui layer.

but we do not want to use this approach beacause it's overriding  already done customization in this layer.

Is there any way to do this without over laying and maintaining our own customization per application(/apps/<myproject>)?

Thanks,

Kishore

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

Hi,

what AEM version are you using? With AEM 6.x you can use the sling resource merge approach [1], where don't have to add nodes into /libs anymore.

kind regards,
Jörg

[1] https://docs.adobe.com/docs/de/aem/6-0/develop/platform/overlays.html

4 replies

smacdonald2008
New Participant
October 16, 2015

To overlay components - the best practice (aka- recommended way)is to move content from /libs to /apps. 

Customizing Components and Other Elements

When creating your own components or customizing an existing component it is often easiest (and safest) to re-use existing definitions. The same principles also applies to other elements within CQ, for example the error handler.
This can be done by copying and overlaying the existing definition. In other words, copying the definition from /libs to /apps/<your-project>. This new definition, in /apps, can be updated according to your requirements.

 

https://docs.adobe.com/docs/en/cq/5-6-1/developing/developing_guidelines_bestpractices.html

Do not modify code under libs - very bad practice. 

joerghoh
joerghohAccepted solution
Employee
October 16, 2015

Hi,

what AEM version are you using? With AEM 6.x you can use the sling resource merge approach [1], where don't have to add nodes into /libs anymore.

kind regards,
Jörg

[1] https://docs.adobe.com/docs/de/aem/6-0/develop/platform/overlays.html

GK-007
GK-007Author
New Participant
October 16, 2015

Thanks Mac for suggestion.

What you said is acceptable and good practice.

But the issue here is we need not to do overlaying and achieve this functionality?

Is there any such option available to do this??

Thanks,

Kishore

smacdonald2008
New Participant
October 16, 2015

You either overlay existing component, create a new component, or modify content under libs (which is very bad practice).