TinyMCE images

4 posts by 2 authors in: Forums > CMS Builder
Last Post: June 8, 2022   (RSS)

By pgplast - June 6, 2022

I believe that there is a way to modify tinyMCE to allow the addition of captions to images inserted into wysiwyg fields inside a CMSB section. However, it is not as yet clear to me how to modify things in a CMSB install to allow this.

Can this be done?

By Dave - June 7, 2022

Hi pgplast, 

Yea, we're currently using TinyMCE v4 and you can find a list of their plugins here: 
https://www.tiny.cloud/docs-4x/plugins/

If you can find (or make) a plugin that does what you want you can include it in the list of tinymce plugins loaded by CMSB in this file:

/cmsb/lib/wysiwyg.php

Just search for the word "plugins" and find this line that loads the various plugins: 

    // Load Plugins - list of available plugins can be found here: https://www.tiny.cloud/docs-4x/plugins/
    plugins: "table,fullscreen,paste,media,lists,charmap,textcolor,link,anchor,hr,paste,image,code,codesample",

Hope that helps!  Let me know any questions.

Dave Edis - Senior Developer
interactivetools.com

By pgplast - June 8, 2022

Dave:

Sorry to waste your time. I found where to put it in your code and the captions are working!

At line 50 in wysiwyg.php, changed to:

<script language="javascript" type="text/javascript"><!--
tinyMCE.init({
mode: "exact",
theme: "modern",
branding: false,
selector: "textarea",
plugins: "image",
menubar: "insert",
toolbar: "image",
image_caption: true,
language: "{$SETTINGS['wysiwyg']['wysiwygLang']}",

Thanks

pgplast