CMS Development

RShaik3
Membre

How to force styling in "Rich Text Module" ?

Résolue

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 Votes
1 Solution acceptée
Anton
Solution
Expert reconnu | Partenaire solutions Diamond
Expert reconnu | Partenaire solutions Diamond

How to force styling in "Rich Text Module" ?

Résolue

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

Voir la solution dans l'envoi d'origine

2 Réponses
Anton
Solution
Expert reconnu | Partenaire solutions Diamond
Expert reconnu | Partenaire solutions Diamond

How to force styling in "Rich Text Module" ?

Résolue

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
Gestionnaire de communauté
Gestionnaire de communauté

How to force styling in "Rich Text Module" ?

Résolue

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