Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Parsys in custom component is not working.

Avatar

Level 2

I have a custom component that I am attempting to add a parsys for authors to drop other custom components into. I am running AEM 6.5.13. I have added a design dialog for use with editable templates. I have used the template editor to allow certain components to be dropped in the parsys. However, the parsys is not allowing any components to be added to it. If I click on my custom component, the "add" icon is in the list of actions and if I click on it, I can select components, everything that is enabled on the page template, but when the component is added, it is added as a sibling to my component instead of a child. 

 

The HTL I'm using to add the parsys to the component is as follows:

<sly data-sly-resource="${resource.path @ resourceType='wcm/foundation/components/parsys/newpar', appendPath='/*', decorationTagName='div', cssClassName='new section aem-Grid-newComponent'}"
data-sly-test="${(wcmmode.edit || wcmmode.preview) && resource.children.size < 1}"></sly>

First, why is this parsys not allowing any components to be added to it. Second, why would added components to my component be added as siblings and not children? 

1 Accepted Solution

Avatar

Correct answer by
Level 8

@Robert-Harper To make this work, you need to add the property "cq:isContainer" and set the value to "true".

shaileshbassi_0-1657608113081.png

Post adding this property it works.

shaileshbassi_1-1657608207134.png

 

Hope this helps.

Thanks

View solution in original post

1 Reply

Avatar

Community Advisor

Hi,

Can you try with

<sly data-sly-resource="${'parsys' @ resourceType='wcm/foundation/components/parsys', decorationTagName='div', cssClassName='new section aem-Grid-newComponent'}"
     data-sly-test="${(wcmmode.edit || wcmmode.preview) && resource.children.size < 1}"></sly>

 

Avatar

Level 7

@Robert-Harper Can you check if there is any required field on the container compoenent to be auhored before authroing the parsys?

Avatar

Level 2

There are fields and attributes to the component that are there. I don't think this is the correct path to a resolution.

Avatar

Correct answer by
Level 8

@Robert-Harper To make this work, you need to add the property "cq:isContainer" and set the value to "true".

shaileshbassi_0-1657608113081.png

Post adding this property it works.

shaileshbassi_1-1657608207134.png

 

Hope this helps.

Thanks