CMS Development

RShaik3
Member

How to force styling in "Rich Text Module" ?

SOLVE

we would like to Force Content Creators to use particular fonts we want them to use. we want to have our own confined typography.

 

Configuring the Rich Text Editor (hubspot.com)
I also have stumbled upon this documentation, which explains how to disable certain features. Bt it's not useful in our case since we do not want to remove features.

0 Upvotes
1 Accepted solution
Anton
Solution
Recognized Expert | Diamond Partner
Recognized Expert | Diamond Partner

How to force styling in "Rich Text Module" ?

SOLVE

Hi @RShaik3

Without modifing the rich-text(only possible with an custom rich-text module) you can't force users to not to use the font-selector in a rich-text (besides educating them why not to use it).

 

technical background: even if you set the fonts in your CSS with the sledgehammer method to "!important" (not recommended) all settings in a rich-text are implemented as inline-styling(worst possible way to style things). Since inline-styling will be rendered after the CSS it will always override it.

 

So you have two options in my opinion:

  • Create custom modules (not only rich-text) for specific usecases like cards where you set up all text elements as text-fields(not rich-text) and if you need a rich-text, you limit it via the JSON file
  • educate your marketers why changing fonts is a no-no 🙂

 

Sometimes giving users less options is a better solution. 

 

 

Hope this helps

 

best, 

Anton

Anton Bujanowski Signature

View solution in original post

2 Replies 2
Anton
Solution
Recognized Expert | Diamond Partner
Recognized Expert | Diamond Partner

How to force styling in "Rich Text Module" ?

SOLVE

Hi @RShaik3

Without modifing the rich-text(only possible with an custom rich-text module) you can't force users to not to use the font-selector in a rich-text (besides educating them why not to use it).

 

technical background: even if you set the fonts in your CSS with the sledgehammer method to "!important" (not recommended) all settings in a rich-text are implemented as inline-styling(worst possible way to style things). Since inline-styling will be rendered after the CSS it will always override it.

 

So you have two options in my opinion:

  • Create custom modules (not only rich-text) for specific usecases like cards where you set up all text elements as text-fields(not rich-text) and if you need a rich-text, you limit it via the JSON file
  • educate your marketers why changing fonts is a no-no 🙂

 

Sometimes giving users less options is a better solution. 

 

 

Hope this helps

 

best, 

Anton

Anton Bujanowski Signature
Jaycee_Lewis
Community Manager
Community Manager

How to force styling in "Rich Text Module" ?

SOLVE

Hey, @RShaik3 Thank you for the interesting question. @Anton and @Stephanie-OG do you have any experience with what  @RShaik3 is trying to accomplish?

 

Thank you very much! – Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot