allowedchildren and allowedparent at cq:component level

Avatar

Avatar
Affirm 5
Level 3
Rajashankar
Level 3

Likes

19 likes

Total Posts

35 posts

Correct reply

8 solutions
Top badges earned
Affirm 5
Boost 10
Affirm 3
Ignite 1
Validate 1
View profile

Avatar
Affirm 5
Level 3
Rajashankar
Level 3

Likes

19 likes

Total Posts

35 posts

Correct reply

8 solutions
Top badges earned
Affirm 5
Boost 10
Affirm 3
Ignite 1
Validate 1
View profile
Rajashankar
Level 3

25-06-2018

Hi All,

I know at template level we have allowedpath,allowedchildren and allowedparent. But i am trying to use allowedparent and allowedchildren at cq:component level.

In detail:

As per the below documentation link from Adobe it seems like CQ:component has property allowedchildren and allowedparent

Custom Node Types

I created a custom page component and baked in two Parsys as shown below

mycomp.jsp

<cq:include path="dumppar" resourceType="foundation/components/iparsys" />

<cq:include path="altpar" resourceType="foundation/components/iparsys" />

and i extended and create a structure component title component and to this component i added property allowedparents as shown below. Meaning this title component should be allowed to drag and drop to "dumppar" parsys. But its is getting dragged and drop allowed in "altpar" parsys comp also,

dragcomp":{"jcr:primaryType":"cq:Component","jcr:createdBy":"admin","jcr:title":"drcmp","allowedParents":["*/dumppar"],"jcr:created":"Mon Jun 25 2018 16:58:46 GMT-0500","sling:resourceSuperType":"/libs/foundation/components/title","componentGroup":"drgcmp"}

Similarly i set the below to mycomp "allowedchildren" as shown below. But my other structure component called "altcomp" is also getting allowed to dropped in mycomp parsys.

{"jcr:primaryType":"nt:folder","jcr:createdBy":"admin","jcr:created":"Mon Jun 25 2018 16:34:23 GMT-0500","dumpcomp":{"jcr:primaryType":"cq:Component","jcr:createdBy":"admin","jcr:title":"dmcp","jcr:created":"Mon Jun 25 2018 16:34:23 GMT-0500","sling:resourceSuperType":"/libs/foundation/components/page","allowedChildren":["*/*dragcomp"],"componentGroup":".hidden","dumpcomp.jsp":{"jcr:primaryType":"nt:file","jcr:createdBy":"admin","jcr:created":"Mon Jun 25 2018 16:34:23 GMT-0500","jcr:content":{"jcr:primaryType":"nt:resource","jcr:lastModifiedBy":"Administrator","jcr:mimeType":"text/plain","jcr:lastModified":"Mon Jun 25 2018 17:04:09 GMT-0500",":jcr:data":285,"jcr:uuid":"c08ef0d3-bde1-4ae9-ba1f-0dfe6447ef74"}}},"dragcomp":{"jcr:primaryType":"cq:Component","jcr:createdBy":"admin","jcr:title":"drcmp","allowedParents":["*/dumppar"],"jcr:created":"Mon Jun 25 2018 16:58:46 GMT-0500","sling:resourceSuperType":"/libs/foundation/components/title","componentGroup":"drgcmp"},"altcomp":{"jcr:primaryType":"cq:Component","jcr:createdBy":"admin","jcr:title":"ac1","jcr:created":"Mon Jun 25 2018 22:53:10 GMT-0500","sling:resourceSuperType":"/libs/foundation/components/logo","componentGroup":"drgcmp"}}

My requirement is I need to set allowedchildren for parsys backed in my component so that only allowed children can be dragged and dropped to parsys or iparsys.Similarly i want to limit at structure components like title or breadcrumb by adding allowedparent allowing it to get added only to mentioned parsys parent.

Please suggest how to use allowedchildren and allowedparent at component level.

Replies

Avatar

Avatar
Give Back 50
Employee
Feike_Visser1
Employee

Likes

247 likes

Total Posts

970 posts

Correct reply

221 solutions
Top badges earned
Give Back 50
Give Back 5
Give Back 3
Give Back 25
Give Back 10
View profile

Avatar
Give Back 50
Employee
Feike_Visser1
Employee

Likes

247 likes

Total Posts

970 posts

Correct reply

221 solutions
Top badges earned
Give Back 50
Give Back 5
Give Back 3
Give Back 25
Give Back 10
View profile
Feike_Visser1
Employee

25-06-2018

To me you can only one of properties, not both at the same time

Avatar

Avatar
Affirm 5
Level 3
Rajashankar
Level 3

Likes

19 likes

Total Posts

35 posts

Correct reply

8 solutions
Top badges earned
Affirm 5
Boost 10
Affirm 3
Ignite 1
Validate 1
View profile

Avatar
Affirm 5
Level 3
Rajashankar
Level 3

Likes

19 likes

Total Posts

35 posts

Correct reply

8 solutions
Top badges earned
Affirm 5
Boost 10
Affirm 3
Ignite 1
Validate 1
View profile
Rajashankar
Level 3

26-06-2018

Hi Visser,

I tried seperately as well as together.Could you please help me with some documentation or reference on this property usage.I am not able to find any in Adobe forum or reference materials on their usage.

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,409 likes

Total Posts

12,671 posts

Correct reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,409 likes

Total Posts

12,671 posts

Correct reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

26-06-2018

You should be using editable templates and policies to address this requirement  if you are using AEM 6.3/6.4. Editable templates and using  polices are best practice.

As well you should be using an AEM Core Page component.