testing
testing

Reputation: 20289

TYPO3: Allow HTML for Rich Text Editor

The default settings of the RTE only allow some types of HTML elements. I also want to allow

How can I do this? I searched a bit and found this:

## RTE configuration
RTE.default {
    proc {
        # tags allowed
        allowTags = table, tbody, tr, th, td, h1, h2, h3, h4, h5, h6, div, p, br, span, ul, ol, li, re, blockquote, strong, em, b, i, u, sub, sup, strike, a, img, nobr, hr, tt, q, cite, abbr, acronym, center

        # html parser configuration
        HTMLparser_rte {

            # tags allowed
            allowTags < RTE.default.proc.allowTags
        }
    }
}

But I'm not sure if this is the right solution ...

Upvotes: 1

Views: 6478

Answers (3)

Viktor Livakivskyi
Viktor Livakivskyi

Reputation: 3228

Answer of @HerrSerker is almost correct - it adds support of extra tags (form, button, input) to RTE, but you also need to allow them at your FE, so the final result should be this:

Page TS

RTE.default.proc.allowTags := addToList(form, button, input)
RTE.default.proc.entryHTMLparser_db.allowTags < RTE.default.proc.allowTags
RTE.default.proc.allowTagsOutside := addToList(form)

allowTagsOutside instructs RTE to allow this tag outside of p-tags.

TS Constants in your TS template

styles.content.links.allowTags := addToList(form, button, input)

Upvotes: 1

yunzen
yunzen

Reputation: 33449

You should add the tags you want to the config

## RTE configuration
RTE.default {
    proc {
        # tags allowed
        allowTags = table, tbody, tr, th, td, h1, h2, h3, h4, h5, h6, div, p, br, span, ul, ol, li, re, blockquote, strong, em, b, i, u, sub, sup, strike, a, img, nobr, hr, tt, q, cite, abbr, acronym, center

        allowTags := addToList(form, button, input) 

        # html parser configuration
        HTMLparser_rte {

            # tags allowed
            allowTags < RTE.default.proc.allowTags
        }
    }
}

Upvotes: 2

Fedir RYKHTIK
Fedir RYKHTIK

Reputation: 9994

Yes. Alos You should unset denyTags and to check entryHTMLparser_db subvalues

An example of default RTE configuration could be found here.

Upvotes: 0

Related Questions