Expand my Community achievements bar.

What is the recommended approach for saving configuration/properties of subcomponents in the JCR when they are dropped/added to a page for the first time

Avatar

Level 7

Hi,

We have a few components that look like this:

<% // some scriptlet %> <!-- the component --> <div class="header"> <cq:include path="logo" resourceType="acme/components/content/logo"/> <cq:include path="social-icons" resourceType="acme/components/content/social-icons"/> </div>

The idea is that in order to keep the Edit Dialog of the header component small, it includes a few sub components such as logo, social icons, etc. each having their own respective Edit Dialogs.

However when this component is initially dropped on to the page, the respective default properties of the component are not stored in the JCR.

For example, for the logo component, in the _cq_editConfig.xml we have something like this:

<cq:formParameters jcr:primaryType="nt:unstructured" config1="x" config2="y" />

But this only comes into effect when the logo component is dropped on to the page, and not the header component.

I can copy something similar to this in the header component's _cq_editConfig.xml, but is there a way to avoid this duplication?

Thanks.

0 Replies