TinyMCE Advanced Link Class List on the main editor

admin2025-01-07  3

I'm using the plugin TinyMCE Advanced and would like to achive a "link_class_list" to the editor when inserting a link. I tried a hundred things, but can't seem to get this work with the main (content) editor. I already set the TinyMCE Advanced link option to 'Other dialog to create/change links' on the settings page. Maybe it's a wrong selector, I really have no clue..

tinymce.init({
    selector: "#content",
    plugins: "link",
    menubar: "insert",
    toolbar: "link",
    link_class_list: [
        [{title: 'None', value: ''},
        {title: 'Button (primary)', value: 'btn btn-primary'},
        {title: 'Button (secondary)', value: 'btn btn-secondary'},
        {title: 'Button (default)', value: 'btn btn-default'}]
    ]
});

Any help would be very much appreciated!

I'm using the plugin TinyMCE Advanced and would like to achive a "link_class_list" to the editor when inserting a link. I tried a hundred things, but can't seem to get this work with the main (content) editor. I already set the TinyMCE Advanced link option to 'Other dialog to create/change links' on the settings page. Maybe it's a wrong selector, I really have no clue..

tinymce.init({
    selector: "#content",
    plugins: "link",
    menubar: "insert",
    toolbar: "link",
    link_class_list: [
        [{title: 'None', value: ''},
        {title: 'Button (primary)', value: 'btn btn-primary'},
        {title: 'Button (secondary)', value: 'btn btn-secondary'},
        {title: 'Button (default)', value: 'btn btn-default'}]
    ]
});

Any help would be very much appreciated!

Share Improve this question asked Sep 17, 2019 at 14:06 DannyDanny 136 bronze badges 1
  • You should be able to use the TinyMCE settings filter. Something like one of my older questions – Howdy_McGee Commented Sep 19, 2019 at 0:05
Add a comment  | 

1 Answer 1

Reset to default 0

I understand the alternative, but I'm looking for a direct way to do this within the "Link dialog". See the image below.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1736258655a530.html

最新回复(0)