(Help ! )Reusable Component Policy For Styling ? | Community
Skip to main content
chun-pin
Level 2
November 2, 2021
Solved

(Help ! )Reusable Component Policy For Styling ?

  • November 2, 2021
  • 1 reply
  • 1101 views

Hi there,

 

We have a requirement, which will have to make the Spacing Styling Options to be available in all Components,
for maintenance reason, we are thinking if there's any way to make the Component Policy For Styling to be Reusable across all components  ?(Container, Teaser, Headlines, Carousel, Container etc..) .

We're wondering if it is possible make it as an abstract component policy ?  then mapping to all other components?

Thank you all so much for taking the time to read this question in advance, any tips and suggestions are appreciated.

Sincerely

Chun-Pin

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 BrianKasingli

@chun-pin,

You can utilise the granite/ui/components/coral/foundation/include, simply create one configuration, for example, margins, within your common namespace folder, as /apps/mybrand/dialogs/content/common/fields,and re-use them across your AEM project. 

 

Here's an example of how we identified one configuration for the richtext granite UI field, and had the entire project reference the same configurations.

https://sourcedcode.com/blog/aem/dry-way-of-using-richtext-granite-ui-component-in-aem-for-static-templates

 

1 reply

BrianKasingli
Community Advisor and Adobe Champion
BrianKasingliCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
November 3, 2021

@chun-pin,

You can utilise the granite/ui/components/coral/foundation/include, simply create one configuration, for example, margins, within your common namespace folder, as /apps/mybrand/dialogs/content/common/fields,and re-use them across your AEM project. 

 

Here's an example of how we identified one configuration for the richtext granite UI field, and had the entire project reference the same configurations.

https://sourcedcode.com/blog/aem/dry-way-of-using-richtext-granite-ui-component-in-aem-for-static-templates

 

chun-pin
chun-pinAuthor
Level 2
November 3, 2021

hi@briankasingli ,
Thank you so much for your help.
Yes. internally we also had a conversation if we should move all stylings options into CQ dialog using granite UI, and get rid of Component Policy Style.

I think there's no better way, isn't it? Again, thank you so much for help. Cheers! 🙂