Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

drop target is not enabled for parsys when included using resourcetype inclusion in htl

Avatar

Level 2

Hello Members, 

I am trying to include parsys in my component to make way for authors to configure a component of their choice. But when this component is included in another component ( cascade include ) , the drop target does not get enabled unless dialog is opened and closed once. Most likely it expects the dialog open and close events to be fired before it enables itself. not sure how do I do that in my code. 

 

I included the parsys like below : 

<sly data-sly-resource="${'par' @@ resourceType=wcm/foundation/components/parsys'}"></sly> 

 

root container

     |---  parent component ( includes child ) 

         |---           child component ( includes grand child which has parsys in it ) 

             |---               grand child ( has parsys in its htl, by using resourcetype usage 

 

I tried enabling the components at template level using policy but not sure if it its the correct solution , but I read a similar thread here and tried that.  I think re-design will be an option I will think of but before that I wanted to understand is this a limitation or I am doing something wrong. 

 

Please suggest. 

 

Regards

Shailesh

 

P.S. its AEM 6.5 with latest service pack. 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @ShaileshPa 
You may need to include the proxy container component,

if you would include the core components as is you need to setup the policies etc.

If you want that childern nodes are created on first drag and drop then you need to use cq:template to create default nodes for a component 



Arun Patidar

View solution in original post

6 Replies

Avatar

Community Advisor

Hi,

I don’t think there is any limitation to embedding parsys within another parsys. However, you should be aware of couple of things. First, it is recommended to use a container component (from the core components) instead of using parsys directly. Second, the inclusion should be made clear. There are some caveats where the parsys inclusion can be problematic, such as including it without a wrapper (directly via a SLY tag), which could be what's happening in your case. Try including the parsys within a <div> tag instead.

 

Lastly, embedding could get messy, so if possible you should try to avoid it especially when it involves several levels of depth. 

 

Hope this helps!



Esteban Bustamante

Avatar

Level 2

Hi,

To add to original post , I tried changing it to container component but the behavior did not change 

 

I mean I tried this ==> 

<sly data-sly-resource="${'par' @ resourceType='core/wcm/components/container/v1/container'}"></sly>

 

please refer the screen shot below: 

 

before I open grandchild component dialog ( I dont see the option to add/drag component ) 

ShaileshPa_0-1727708406257.png

and later I am able to see once dialog is opened and closed 

 

ShaileshPa_1-1727708562755.png

any suggestions ? 

 

Also want to add another observation that the nodes do not get created on first component drop, but they only get created when the dialog of grand child is opened and closed. 

Avatar

Correct answer by
Community Advisor

Hi @ShaileshPa 
You may need to include the proxy container component,

if you would include the core components as is you need to setup the policies etc.

If you want that childern nodes are created on first drag and drop then you need to use cq:template to create default nodes for a component 



Arun Patidar

Avatar

Level 2

that @@ (twice) is a typo while putting details in case, its not there in the code .. plz ignore that 

 

also can you suggest , which of these three should be marked for cq:isContainer ? currently all of them are marked as true for cq:isContainer. 

Avatar

Community Advisor

Hi @ShaileshPa ,

You can extend container component and override the required file where you want custom changes if any class or div

MukeshYadav__0-1727711167619.png

MukeshYadav__1-1727711268006.png

 

Thanks