Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7013159
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:21:02+00:00 2026-05-27T22:21:02+00:00

I want that the user should be able to select an textstyle in RTE

  • 0

I want that the user should be able to select an textstyle in RTE like Detail, Important, Name of person and so on. So I would like to define a CSS and this option should be shown in RTE. The CSS style should be a span and only setting a color.

Currently I have the following code:

RTE.classes{
  highlight{
      name = test
      value = color:#0A8AD2;
  } 
}

RTE.default{
  ignoreMainStyleOverride = 1 
  useCSS = 1
  contentCSS = fileadmin/templates/css/rte_formats.css
  classesCharacter := addToList(highlight)
  classesParagraph := addToList(highlight)
  proc.allowedClasses := addToList(highlight)
}

The content of the CSS file is

span.highlight, p.highlight {
    color:#0A8AD2;
}

But the new added style isn’t shown in the drop down (textstyle). I also enabled “additonal inline elements” in th rtehtmlarea configuration. I also tried to set showTagFreeClasses and so on without success. Then I read about caching problems. I deleted the RTE cache as well as the browser cache. Still no result. What can be wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T22:21:03+00:00Added an answer on May 27, 2026 at 10:21 pm

    You are basically on the right track!

    I have experienced quite some problems using inlineStyle. One of them being that you have to explicitly undefine the contentCSS to make the inlines work (only setting ignoreMainStyleOverride = 0 is not enought!):

    RTE.default.contentCSS >
    

    I personally prefer a dedicated external CSS file. The important thing to know is that the TYPO3 RTE really parses this CSS file and only offers those classes that are actually found in there!
    So you have to use the contentCSS parameter to define a CSS and this CSS must really contain the classes that you want to make available to the user. Here is how you must define it:

    # TS-Config
    RTE.default.ignoreMainStyleOverride = 1
    RTE.default.contentCSS = fileadmin/templates/css/rte_formats.css
    

    The CSS file must exist at the give URL and it must contain a definition for the CSS class that you want to provide (as said the CSS file is really parsed and missing classes will not show up in the dropdown selector):

    /* content of rte_formats.css */
    /* span. needed for RTE.default.classesCharacter */
    /* p.    needed for RTE.default.classesParagraph */
    span.highlight, p.highlight{ color:#0A8AD2; }
    

    And one more hint:
    I recommend not to overwrite the allowedClasses with your own class name(s), but append to them:

    RTE.default.proc.allowedClasses := addToList( highlight, myOtherClass, myThirdClass )
    

    Good luck!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a user that want to be able to select a textbox and
I want that the user shouldn't be able to resize the window form. I
Here is what I want to happen: The user should click a link/button that
i have list of rows that user select and i want to delete them,
I have a RichFaces pickList from which the user should be able to select
I want that user/attacker to encrypt the data and send to server. Now I
When I disabled Numeric UpDown control I want that user can still read its
I want to post on twitter wall but don't want that user can edit
I have 2 site: example.com and exampletwo.com I want that when a user login
I want to be sure that user uploaded files are real videos or pictures,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.