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

SOLVED

Apply css styling in content fragment

vinaydkarde
Level 2
Level 2

I want to apply different css styling such as  font-family, color etc to my content in content fragment.

1 Accepted Solution
Arun_Patidar
Correct answer by
Community Advisor
Community Advisor

Hi Lokesh,

I didn't try it but I can give a try, though I created a components where you can include CF and if you can add one more dropdown to select style and this style can be directly used in top div or wrapper element.

https://aemlab.blogspot.com/2018/09/aem-content-fragment-with-component.html

View solution in original post

0 Replies
Lokesh_Shivalingaiah
Community Advisor
Community Advisor

Actually, I have a similar usecase for me and couldnt find any option !

Arun_Patidar
Community Advisor
Community Advisor

You can trying this by extending existing content fragment to add style system and based on class selected you can write CSS rules for font and color etc.

Adobe Experience Manager Help | Style System

Lokesh_Shivalingaiah
Community Advisor
Community Advisor

Have you tried it Arun ? As of today there is no way to create even the template for content fragments from the frontend and need to be created from backend. So just curious to know..

Arun_Patidar
Correct answer by
Community Advisor
Community Advisor

Hi Lokesh,

I didn't try it but I can give a try, though I created a components where you can include CF and if you can add one more dropdown to select style and this style can be directly used in top div or wrapper element.

https://aemlab.blogspot.com/2018/09/aem-content-fragment-with-component.html

View solution in original post

Lokesh_Shivalingaiah
Community Advisor
Community Advisor

Yes! This is the approach I am using as a workaround for sometime now

Prarthana_Sharm
Level 2
Level 2

I have similar use case where I want to change the style(color, position) of text in different variations. Is this even possible in content fragment or experience fragment?

So the requirement is where we need to update content in one place but stylize content in different variations.

Please suggest.