Expand my Community achievements bar.

SOLVED

(Help ! )Reusable Component Policy For Styling ?

Avatar

Level 2

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

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@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-te...

 

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

@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-te...

 

Avatar

Level 2

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!