drop target is not enabled for parsys when included using resourcetype inclusion in htl | Community
Skip to main content
Level 2
September 30, 2024
Solved

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

  • September 30, 2024
  • 2 replies
  • 1043 views

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. 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by arunpatidar

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 

2 replies

EstebanBustamante
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
September 30, 2024

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
Level 2
September 30, 2024

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 ) 

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

 

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. 

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
September 30, 2024

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
MukeshYadav_
Community Advisor
Community Advisor
September 30, 2024
Level 2
September 30, 2024

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. 

MukeshYadav_
Community Advisor
Community Advisor
September 30, 2024

Hi @shaileshpa ,

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

 

Thanks