TYPO3 add textstyles to RTE

From snippet wiki
Jump to navigation Jump to search

Making just a small addition to the RTE can be difficult. With a 6.2 TYPO3 LTE version one might use these lines in the page TSconfig of your root:

RTE.default {
	contentCSS = fileadmin/tpl/rte.css
	buttons.textstyle.showTagFreeClasses = 1

	buttons.textstyle.tags.span.allowedClasses ( 
		dropdown, lueckentext
	)

	proc.allowedClasses {
		dropdown, lueckentext
	}
}
RTE.config.tt_content.bodytext.proc.allowedClasses = dropdown, lueckentext

and add the referenced css file to your fileadmin/tpl path:

.lueckentext {
  border-bottom: 2px solid #000;
  color: #009;
}
.dropdown {
  border: 1px solid #000;
  border-bottom: 2px solid #000;
  color: #009;
}