?
avatar ducklin5
ducklin5
19 Aug 2017

where in the joomla backend can I extend the TinyMCE editor? Im trying to add this plugin to the tinymce editor in my joomla install. This plugin requires that I set specific options in the tinymce init function. Im not even sure where to run this function :

tinymce.init({
  selector: "textarea",
  //inline: true, //for contenteditable selector
  forced_root_block : "", //!important
  force_br_newlines : true, //!important
  force_p_newlines : false, //!important
  valid_elements: "br", //!important
  paste_as_text: true, //!important
  external_plugins: {
    twExoticMarkdownEditor: "[[++assets_url]]components/tinymcewrapper/tinymceplugins/twExoticMarkdownEditor.js", //!important
    bubbleBar: "[[++assets_url]]components/tinymcewrapper/tinymceplugins/tinymceBubbleBar.js", //!important
    twPreCodeManager: "[[++assets_url]]components/tinymcewrapper/tinymceplugins/twPreCodeManager.js",
    modxMagicHoverLink: "[[++assets_url]]components/tinymcewrapper/tinymceplugins/modxMagicHoverLink.js",
  },
  twExoticMarkdownEditorSettings: {
    addClass: false, //default is true (add .twExoticMarkdownEditor class to editor body)
    removeClasses: "a b c", // remove class(es) when editor loads - smoothly reveal editor only after text has been prepared
    skipClass: "", // do not process this particular editor content, skip it!
    addAttr: false, //default is true (add markdown="1" to editor body) good for parsing mixed content in mark/parsedownExtra
  },
  plugins: "paste contextmenu save searchreplace", //!important
  toolbar: "modxMagicHoverLink twPreCodeManager boldMD italicMD linkMD imageMD blockquoteMD codeMD numlistMD bullistMD tableMD undo redo searchreplace bubbleBarOptionsButton", //!important
  menubar: false,
  contextmenu: "modxMagicHoverLink twPreCodeManager boldMD italicMD linkMD imageMD blockquoteMD codeMD numlistMD bullistMD tableMD undo redo searchreplace template" //!important
})
avatar ducklin5 ducklin5 - open - 19 Aug 2017
avatar joomla-cms-bot joomla-cms-bot - change - 19 Aug 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 19 Aug 2017
avatar franz-wohlkoenig franz-wohlkoenig - change - 20 Aug 2017
Category com_plugins
avatar joomla-cms-bot joomla-cms-bot - edited - 20 Aug 2017
avatar brianteeman
brianteeman - comment - 20 Aug 2017

Adding extra plugins is not something that is fully supported. You can add a plugin using the penultimate field on the tinymce plugin called "Custom plugin" but I think that only allows you to add the plugin name and not the params you need. For that you would need to edit one of the core files and the danger there is that you will lose any changes on an update. The forum is the best place to ask this see https://forum.joomla.org

avatar brianteeman brianteeman - change - 20 Aug 2017
Status New Closed
Closed_Date 0000-00-00 00:00:00 2017-08-20 10:04:21
Closed_By brianteeman
avatar brianteeman brianteeman - close - 20 Aug 2017
avatar ducklin5
ducklin5 - comment - 20 Aug 2017

What about a feature request?
Perhaps it would be beneficial to add a "custom plugin settings" field after "custom plugins" in the backed UI. Just a simple text box where the code for plugin settings can be typed in manually. Then that code gets added to the end of the init call parameter.

avatar Fedik
Fedik - comment - 21 Aug 2017

you can add any custom options to TinyMCE before render, use onBeforeCompileHead event.
See #11157 and #10996

avatar brianteeman
brianteeman - comment - 21 Aug 2017

Thanks for that update @Fedik

Add a Comment

Login with GitHub to post a comment