tinymce / tinymce-contentful

TinyMCE for Contentful
https://www.tiny.cloud/blog/is-the-headless-cms-the-future-of-content-publishing/
Apache License 2.0
7 stars 32 forks source link

Trying to add more settings (content_css, external_plugins, etc) #3

Open orjanb-ne opened 3 years ago

orjanb-ne commented 3 years ago

I've been trying to add more settings to the TinyMCE editor, but without success. The Extension is not recognizing my parameters.

Here is my code: `var p = tweak(api.parameters.instance.plugins); var tb = tweak(api.parameters.instance.toolbar); var mb = tweak(api.parameters.instance.menubar);
var sf = tweak(api.parameters.instance.style_formats); var ep = tweak(api.parameters.instance.external_plugins); var cc = tweak(api.parameters.instance.content_css); var vb = tweak(api.parameters.instance.visualblocks_default_state); var ec = tweak(api.parameters.instance.end_container_on_empty_block);

api.window.startAutoResizer();

tinymce.init({
  selector: "#editor",
  plugins: p,
  toolbar: tb,
  menubar: mb,
  style_formats: sf,
  external_plugins: ep,
  content_css: cc,
  visualblocks_default_state: vb,
  end_container_on_empty_block: ec,`

I've tried to add the external plugin (and content_css) in my forked repo and then pointing directly to that file, but TinyMCE isn't even trying to load that URL on init.

Here are my settings:

"toolbar": "undo redo | removeformat | tiny_mce_wiris_formulaEditor | help", "menubar": "edit insert", "external_plugins": { "tiny_mce_wiris": "URL to plugin" }

exalate-issue-sync[bot] commented 3 years ago

Ref: INT-2593

jscasca commented 3 years ago

Hey @orjanb-ne

I don't think using the tweak function there would work for external plugins since you will return an string and the configuration takes an object. You would probably need to parse that as a JSON string instead.