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

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list

Reusing Component policy in another component

Avatar

Level 1

I have defined the component policy for COMPONENT A. Is it possible to reuse the Component policy of COMPONENT A in COMPONENT B?

@smacdonald2008 

3 Replies

Avatar

Community Advisor

Try with

 <componentB
cq:policy="aemlab/oneweb/components/image/policy_componentA"
jcr:primaryType="nt:unstructured"
sling:resourceType="wcm/core/components/policies/mapping"/>

Avatar

Level 1

Thanks for the reply @arunpatidar 

Let me reframe my requirement here. I have defined Styles on Component A Policy and I want to reuse this Component A Styles on Component B in addition to the Component B Specific Styles.

Requirement here is to reuse already defined styles of Component A on Component B and Components B should also have its own policy. 

 

The above solution which you provided will only inherit component A policy on component B.

Avatar

Community Advisor

The policy combination is not supported. you can't refer two policies at the same time.