How to drag and drop a component over other components (other than parsys) in CQ5?

StackOverflow https://stackoverflow.com/questions/22953422

  •  30-06-2023
  •  | 
  •  

Вопрос

I have created a button component in CQ5 without inheriting existing button component. Now I want to

place this button component over another custom Banner component by drag and drop method from sidekick. I gave the banner comp as parent for my button and in banner I gave this button in allowed children and made it as container too. also I have created design dialog for the banner component where I added this button component in allowed components option. still I am not able to drag and drop this button over the banner, as its going either above or below this banner and the banner itself is inside parsys. if I include the component via jsp, its working fine. but I must do it by drag and drop.

I am new to CQ5, appreciate any help I can get. thanks in advance.

Это было полезно?

Решение

A parsys is the fundamental container component for composition. Applying this functionality manually into another component would require quite a bit of custom configuration.

If you look at the parsys at /libs/foundation/components/parsys, you will see that it is defined as a container by the property cq:isContainer - true, which instructs CQ to allow for drag and drop. There are multiple sub nodes that will need to be defined etc.

If you are trying to limit only a particular component to be dropped in, this may make sense, and yo should look at the image component, however, the best approach is to make a component that contains a parsys.

Remember that the author's should have the ability to add as much as they want to, and a single object does not allow for this flexibility. You should be handling bad author activity through a review process before the content is published, rather than enforcing it on a software level.

Hope that helps.

Другие советы

Drag and Drop feature is available on Parsys or IParsys only. So to achieve your requirement you need to include parsys in banner component. If you want to restrict banner parsys to allow button component, please use design config and select button component in button's parsys

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top