[TYPO3-rte] custom block styles

B.Wolf bw at shs-it.de
Mon Nov 23 16:43:57 CET 2009


Hi there,

I want to use custom block styles in my RTE.
For this purpose I've put the following TS to the PAGE TS Config of the 
site root:

RTE {
     default {
         # link to site css stylesheet
         contentCSS = fileadmin/template/css/main.css

         # clear typical styling
         classesAnchor >
         classesLinks =
         # set classes available to these properties. Paragraph is 
another name
         # for block
         classesCharacter := addToList(coding, note, important, warning)
         classesParagraph := addToList(coding, note, important, warning, 
float_left, center, float_right)
         classesTD := addToList(sub)
         classesTable := addToList(full, fixed)

         # list all available classes here, otherwise they're removed on 
RTE save
         proc.allowedClasses := addToList(coding, note, important, 
warning, float_left, center, float_right, sub, full, fixed)
     }
}

The css-file I use was extended with the this classes:

.coding { font-family: monospace; font-size: 1.1em;}
.note {background: #dfd; padding: 1em; border-top: 1px #bdb dotted; 
border-bottom: 1px #bdb dotted;}
.important {background: #ffd; padding: 1em; border-top: 1px #ddb dotted; 
border-bottom: 1px #ddb dotted;}
.warning {background: #fdd; padding: 1em; border-top: 1px #dbb dotted; 
border-bottom: 1px #dbb dotted;}
.float_left { float: left; display:inline; margin-right: 1em; 
margin-bottom: 0.15em;}
.float_right { float: right; display:inline; margin-left: 1em; 
margin-bottom: 0.15em;}
.center { text-align:center; margin: 0.5em auto}

/* these are for showing alignment in RTE on the backend */
.align-left { text-align: left; }
.align-center { text-align: center; }
.align-right { text-align: right; }
.align-justify { text-align: justify; }




When I open the RTE now, I can see that it is using the stylesheet given 
in contentCSS, but the "Block style"-Selector box is grayed and so not 
avaiable.
Missed I something?

Thanks for you help,
Ben


More information about the TYPO3-project-rte mailing list