Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

How to define policy for nested container component

johns56194565
Level 2
Level 2

I need to understand with editable templated how can we define the policy for a component that has a nested parsys and this component can be put on a page multiple times like If i have a component called testComponent it has a container in template using parsys:

<div data-sly-resource="${ 'blockParsys' @ resourceType='wcm/foundation/components/parsys'}" ></div> Then is component is put on a page multiple times. it will generate content structure like this:

 

  • my-page
    • jcr:content
      • root
        • my-component ( resourceType: apps/myProject/components/testComponent)
        • my-component_xxxxxxxxx ( resourceType:apps/myProject/components/testComponent)

 

The policy could be set for the first component dragged but does not remain for the following components. Can someone please help me with a sample component that have a parsys with policy set and could be dragged on the page multiple times.

 

@ChitraMadan  @Arun_Patidar @BrianKasingli 

5 Replies
Arun_Patidar
Community Advisor
Community Advisor

you can define template include policy like

 

<testComponent jcr:primaryType="nt:unstructured">
	<parsys
		cq:policy="myapp/core/components/content/testComponent/policy_parsys"
		jcr:primaryType="nt:unstructured"
		sling:resourceType="wcm/core/components/policies/mapping"/>
</testComponent>

 

 

johns56194565
Level 2
Level 2
Hi @Arun_Patidar here parsys was included via HTL. Can you share and example component here if possible with nested parsys having policy defined?
Arun_Patidar
Community Advisor
Community Advisor

We are using a table component where we added parsys to include component in cell.

 

        <table
                cq:policy="myapp/components/content/table/policy_myapp_table_all"
                jcr:primaryType="nt:unstructured"
                sling:resourceType="wcm/core/components/policies/mapping">
                <wcm jcr:primaryType="nt:unstructured">
                    <foundation jcr:primaryType="nt:unstructured">
                        <components jcr:primaryType="nt:unstructured">
                            <parsys
                                cq:policy="myapp/components/content/table/policy_myapp_table_cell_parsys_default"
                                jcr:primaryType="nt:unstructured"
                                sling:resourceType="wcm/core/components/policies/mapping"/>
                        </components>
                    </foundation>
                </wcm>
            </table>
johns56194565
Level 2
Level 2
Hi @Arun_Patidar If you can share an example component with nested parsys and its policies in a package that would be really of great help.
Arun_Patidar
Community Advisor
Community Advisor

Hi johns56194565, The project is client specific so I can't share but you can try from your end

1. Create policy at /conf/myproj/settings/wcm/policies/.content.xml

2. refer this policy in the template at /conf/myproj/settings/wcm/templates/page-content/policies/.content.xml similar as I posted in the last example.