Expand my Community achievements bar.

SOLVED

Parsys in custom component is not working.

Avatar

Level 4

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
Community Advisor

@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

6 Replies

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>

 



Arun Patidar

Avatar

Community Advisor

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

Avatar

Level 4

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
Community Advisor

@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

Avatar

Level 1

Hi Shailesh,

 

I tried by adding cq:isContainer property for the root component node and tried the below snippet to get the parsys in the root component, but it's not working, please help with any other way for this.

 

<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>

 

SurendraKo_0-1718113118799.png

 

When i tried to add the components to the parsys, i am getting the below error and i am using AEM6.5 version.

SurendraKo_0-1718117032435.png

 

Regards,

Surendra k