PopMal
PopMal

Reputation: 61

How to add attribute to html tag for tinyMce editor?

We use a episerver tinyMce on the backend and configure through the ServiceCollectionExtention (screen 1).Now there is a need to add an attribute inside the "html" tag as in the screenshot below (screen 2). Due to the fact that the documentation is not written for a style suitable for the net, I can not understand how I can do this. I will be glad to any offer. Thank you.

screen1:

screen1

screen2:

screen2

Upvotes: 1

Views: 31

Answers (1)

Ian Carter
Ian Carter

Reputation: 2169

First add html[data-test] to extended_valid_elements and also this:

    .AddSetting("setup", @"function(editor) {
        editor.on('init', function() {
            editor.getBody().parentNode.setAttribute('data-test', 'test');
        });
    }")

Upvotes: 0

Related Questions