rszczypka
rszczypka

Reputation: 43

Typo3 - wrap content coming from RTE into a div tag

I need a custom styling for different elements (ul li, ol li, tables, links etc.) that are added through Typo3 RTE.

Thus I want to configure the RTE so every time some content is added through RTE it is outputted in the front-end with a wrapping div e.g. <div class="added_through_rte"></div>.

Is there a way to do it?

Upvotes: 1

Views: 1398

Answers (1)

Artur Cichosz
Artur Cichosz

Reputation: 1054

Put this in yout TypoScript setup

tt_content.text.20.wrap = <div class="added_through_rte"> | </div>

This wraps all content from the field "text" of the table tt_content.

If you use RTE in other records, you will have to configure each one in a simmilar way.

On the other hand, you can define custom CSS classes for the most elements (ul, ol, links, headers, paragraphs etc.) managed by a RTE. This is a lot more configure work but more flexibel, so you can have many different list classes to chose from etc. This is quite a huge topic and lot to research.

Upvotes: 2

Related Questions