Can't add child components to containers | Community
Skip to main content
Level 2
February 13, 2023

Can't add child components to containers

  • February 13, 2023
  • 2 replies
  • 2372 views

I'm trying to use the AEM core form container, but when I add it to a page, there is no ability to add child elements (there is no "Drag Components Here" box).  When I click the + sign on the component, it only adds the component I choose as a sibling, not a child of the container. Here is the .content.xml:

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="cq:Component"
cq:isContainer="{Boolean}true"
jcr:title="Form Container"
jcr:description="Container for other form components"
sling:resourceSuperType="core/wcm/components/form/container/v2/container"
componentGroup="mygroup"
/>

Shouldn't the isContainer property allow me to add child components? I have my template policy and the container component policies set to allow certain components. 

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

2 replies

Manu_Mathew_
Community Advisor
Community Advisor
February 14, 2023

@dms879090 

cq:isContainer Boolean Indicates whether the component is a container component and therefore can contain other components such as a paragraph system.

You could probably create a subgroup and add it to the policies. cq:isContainer  would make a tree structure for the content tree.

dms879090Author
Level 2
February 14, 2023

If I use the component as I currently have it, I am able to add it to a we.retail hero page and it works as expected (it displays "Drag Components Here" in the editor and I can add child components). I updated the policy for the page, layout container that I add my component to, and the component itself to make sure it was an allowed component and had allowed components for children, still no luck.

 

But when I add the component to one of my custom pages, it doesn't allow me to add child components and does not show "Drag Components Here".  The same is true if I try to use a we.retail form container component on my custom page.

DEBAL_DAS
New Member
February 14, 2023

I would suggest you follow the we.retail form container component and here is the component's path: /apps/weretail/components/form/container.

 

If you take a look at /apps/weretail/components/form/container/new and follow the similar approach, then you will be to add components within Form container.

 

Please give a try.

Debal Das, Senior AEM Consultant
dms879090Author
Level 2
February 14, 2023

If I use the component as I currently have it, I am able to add it to a we.retail hero page and it works as expected (it displays "Drag Components Here" in the editor and I can add child components). I updated the policy for the page, layout container that I add my component to, and the component itself to make sure it was an allowed component and had allowed components for children, still no luck.

 

But when I add the component to one of my custom pages, it doesn't allow me to add child components and does not show "Drag Components Here".  The same is true if I try to use a we.retail form container component on my custom page.

DEBAL_DAS
New Member
February 14, 2023

Are you seeing any error in browser console while using your application specific page?

 

Please create a new page with your application specific template and don't add any other component on that page.

Then add your form container component and check whether it allows you to add any component.

Debal Das, Senior AEM Consultant