Not able to call form in AEM6

154 Views Asked by At

I have copied the Forms from the /libs/foundation/components/form to /apps/mywebsite/components/form, I made some changes to the copied form files but still the default form is getting called.

Could you let me know or provide some documentation for the forms.

Thanks in advance

2

There are 2 best solutions below

0
On

If you didn't want to overrride but extend the foundation forms, you need to make sure that you copied everything or have the inheritance to foundation right. Most important is the cq:editConfig/cq:formParameters, where you need to have sling:resourceSuperType="foundation/components/form/defaults/field". If you use a cq:template instead, you need to set the supertype parameter there.

Then you would have to use your components on the page instead of the foundation ones.

0
On

The problem is that you moved things to: /apps/mywebsite/components/form

Instead, you need to copy them to: /apps/foundation/components/form

apps overrides libs ONLY if the path is otherwise the same so: /apps/something/something/somethingelse will override: /libs/something/something/somethingelse

if ANY part of that path is different, that overlay won't work.

In addition, if something calls a component/resource/whatever under /libs using the fully qualified name (e.g. actually including /libs/ at the beginning) then it will still use that. But this is rare.

Let me know if you have more issues.

BTW, you can change this search approach (apps before libs) in the resource resolver settings in OSGI. It comes this way by default but can be changed.