Experience Fragment - allow specific components to be nested within a component and hide from layout container | Community
Skip to main content
Level 9
December 6, 2022
Solved

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

  • December 6, 2022
  • 1 reply
  • 1546 views

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?

 

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 NitroHazeDev

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


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



1 reply

aanchal-sikka
Community Advisor
Community Advisor
December 6, 2022

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
Level 9
December 6, 2022

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

NitroHazeDevAuthorAccepted solution
Level 9
December 6, 2022

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


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