Is it possible to duplicate and reuse the contents of <item0 cq:styleGroupLabel="Modifier"> in the component style system? | Community
Skip to main content
Level 2
September 3, 2024
Question

Is it possible to duplicate and reuse the contents of <item0 cq:styleGroupLabel="Modifier"> in the component style system?

  • September 3, 2024
  • 1 reply
  • 494 views

I need to apply common styles to multiple components. I’m considering copying the settings imported from AEM in ui.content\src\main\content\jcr_root\conf\xxx\settings\wcm\policies\.content.xml and pasting them into other components.

In this case, is it acceptable for cq:styleId to be duplicated across components?
For example, below is a portion of the policy for the text component. I would like to duplicate the content inside the cq:styles tag and use it for other components.

 

 

<text jcr:primaryType="nt:unstructured"> <policy_1710140125554 jcr:lastModified="{Date}2024-03-14T09:11:38.218Z" jcr:lastModifiedBy="admin" jcr:primaryType="nt:unstructured" jcr:title="Text Common" sling:resourceType="wcm/core/components/policy/policy"> <jcr:content jcr:primaryType="nt:unstructured"/> <rtePlugins jcr:primaryType="nt:unstructured"> <paraformat jcr:primaryType="nt:unstructured" features="-"> <formats jcr:primaryType="nt:unstructured" override="true"> <item0 jcr:primaryType="nt:unstructured" description="Paragraph" tag="p"/> <item1 jcr:primaryType="nt:unstructured" description="Heading 1" tag="h1"/> <!-- omitted for brevity --> </formats> </paraformat> <!-- omitted for brevity --> </rtePlugins> <cq:styleGroups jcr:primaryType="nt:unstructured"> <item0 cq:styleGroupLabel="Modifier" jcr:primaryType="nt:unstructured"> <cq:styles jcr:primaryType="nt:unstructured"> <item0 cq:styleClasses="cmp-text--text-shadow" cq:styleId="1710140168062" cq:styleLabel="Text Shadow" jcr:primaryType="nt:unstructured"/> <item1 cq:styleClasses="cmp-text--strong" cq:styleId="1710140181421" cq:styleLabel="Strong" jcr:primaryType="nt:unstructured"/> <!-- omitted for brevity --> </cq:styles> </item0> <!-- omitted for brevity --> </cq:styleGroups> </policy_1710140125554> </text>

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

arunpatidar
Community Advisor
Community Advisor
September 3, 2024

Hi @hnakamura 
Unfortunately, you can't reuse.

 

You need to copy-paste same policy/style snippet for other component's policy.

Arun Patidar