Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Experience Fragment - allow specific components to be nested within a component and hide from layout container

Avatar

Level 10

Hi,

 

I have a layout container within a template for an experience fragment and added components into it. Now i have a component-A that can have nested components within it. 

This is based on editable templates

Layout container -> contains componentA and component A can have a set of new components that can only be added if component A is dragged. These new components will not be visible in the layout container.

@arunpatidar 

 

Is there a way to achieve this for an XF based on editable template where components will not be visible for the layout container but only be visible when one wants to add components within component A?

 

1 Accepted Solution

Avatar

Correct answer by
Level 10

Please find steps for anyone in need and thank you  @aanchal-sikka 

1. Within CRX/DE , created a policy
/conf/XYZ/settings/wcm/policies/XXX/components/content/component/component_policy
with res type - wcm/core/components/policy/policy
components string[] - list of components


2. Create a mapping
/conf/XYZ/settings/wcm/templates/custom_template/policies/jcr:content/root/XXX/components/content/component

res:type - mapping- wcm/core/components/policies/mapping
policy - map it to the policy created above  - XXX/components/content/component/component_policy



View solution in original post

6 Replies

Avatar

Community Advisor

The components allowed in a container are based on policies.

Assuming componentA is also a container component, one can have separate policies for Layout container and Component A.

By default, the Component List on Left panel will show all components, that should be ok.

You would only be able to drop components in componentA/Layout-container, based on their policies.


Aanchal Sikka

Avatar

Level 10

Hi @aanchal-sikka  , component A is dragged within the layout container. Is there a way to add policies to component A to be able to drag drop only certain components ? Please let me know

Avatar

Community Advisor

Add policy to the component via its Editable template. 

- Go to the Editable template

- Click on policy button next to the ComponentA

 

aanchalsikka_1-1670342597349.png

- Create a policy with the necessary allowed components

 


Aanchal Sikka

Avatar

Level 10

I don't happen to see a policy button near the custom component similar to few you have in there 

Avatar

Level 10

Will post steps. I believe i may have the answer to this.

Avatar

Correct answer by
Level 10

Please find steps for anyone in need and thank you  @aanchal-sikka 

1. Within CRX/DE , created a policy
/conf/XYZ/settings/wcm/policies/XXX/components/content/component/component_policy
with res type - wcm/core/components/policy/policy
components string[] - list of components


2. Create a mapping
/conf/XYZ/settings/wcm/templates/custom_template/policies/jcr:content/root/XXX/components/content/component

res:type - mapping- wcm/core/components/policies/mapping
policy - map it to the policy created above  - XXX/components/content/component/component_policy