Is there a way to reuse AEM policy styleGroups?
I'm starting working with AEM style System and I'm facing a challenge regarding reusability. I have a ColumnControl which has more than one column, and I need to offer authors several styles for the columns – which I've already implemented through a policy linked to the columns.
<policy_col
jcr:primaryType="nt:unstructured"
sling:resourceType="wcm/core/components/policy/policy"
components="[...]">
<cq:styleGroups jcr:primaryType="nt:unstructured">
<style1
jcr:primaryType="nt:unstructured"
cq:styleGroupLabel="1">
<cq:styles jcr:primaryType="nt:unstructured">
...
</cq:styles>
</style1>
<style2
jcr:primaryType="nt:unstructured"
cq:styleGroupLabel="2">
<cq:styles jcr:primaryType="nt:unstructured">
...
</cq:styles>
</style2>
...
But each column needs to allow different components, which means each column needs to have a different policy. But I wouldn't like to have to repeat all the styles for both policies:
<policy_col1
jcr:primaryType="nt:unstructured"
sling:resourceType="wcm/core/components/policy/policy"
components="[...]">
<cq:styleGroups jcr:primaryType="nt:unstructured">
<style1
jcr:primaryType="nt:unstructured"
cq:styleGroupLabel="1">
<cq:styles jcr:primaryType="nt:unstructured">
...
</cq:styles>
</style1>
<style2
jcr:primaryType="nt:unstructured"
cq:styleGroupLabel="2">
<cq:styles jcr:primaryType="nt:unstructured">
...
</cq:styles>
</style2>
</cq:styleGroups>
</policy_col1>
<policy_col2
jcr:primaryType="nt:unstructured"
sling:resourceType="wcm/core/components/policy/policy"
components="[... different list]">
<cq:styleGroups jcr:primaryType="nt:unstructured">
<style1
jcr:primaryType="nt:unstructured"
cq:styleGroupLabel="1">
<cq:styles jcr:primaryType="nt:unstructured">
...
</cq:styles>
</style1>
<style2
jcr:primaryType="nt:unstructured"
cq:styleGroupLabel="2">
<cq:styles jcr:primaryType="nt:unstructured">
...
</cq:styles>
</style2>
</cq:styleGroups>
</policy_col2>
Is there any way I can link one policy to an already defined anywhere cq:styleGroups?