Notifications
Clear all

How to install plugins for TinyMCE?

4 Posts
2 Users
0 Likes
233 Views
Posts: 4
Topic starter
(@addooua)
Active Member
Joined: 3 months ago

Hello! I want to expand the functionality of the TinyMCE editor on the wpForo forum using the provided plugins from the TinyMCE developer, here is a link to the site https://www.tiny.cloud/docs/plugins/opensource/. Please tell me how to implement this on wpForo

3 Replies
Posts: 4
Topic starter
(@addooua)
Active Member
Joined: 3 months ago

I want to add the ability for the "Image" tool to load images from a computer, https://www.tiny.cloud/docs/plugins/opensource/image/

Reply
Robert
Posts: 10503
Admin
(@robert)
Support Team
Joined: 8 years ago

Hi @addooua,

I'm sorry but there is no way to do this. The image button requires lots of backend processes and file uploading functions, it's not just a button. If you want to have an extended file attaching and displaying options you can check out wpForo Advanced Attachments addon: https://gvectors.com/product/wpforo-advanced-attachments/

Reply
1 Reply
(@addooua)
Joined: 3 months ago

Active Member
Posts: 4

@robert The fact is that I want to use the functionality of the TinyMCE editor, which is used by the wpForo forum. This editor is great at inserting images, you just need to add this functionality using tinymce.init({}).
I managed to do this in the TinyMCE editor for Wordpress, I want to repeat this with TinyMCE for wpForo.

Please tell me where to insert the tinymce.init initialization code so that it works in the TinyMCE wpForo editor?

tinymce.init({
                    selector: 'textarea',
                    plugins: 'image',
                    menubar: 'insert',
                    toolbar: 'image',
                    a11y_advanced_options: true,
                    image_title: true,
                    automatic_uploads: true,
                    file_picker_types: 'image',
                    file_picker_callback: function (cb, value, meta) {
                        var input = document.createElement('input');
                        input.setAttribute('type', 'file');
                        input.setAttribute('accept', 'image/*');

                        input.onchange = function () {
                            var file = this.files[0];
                            var reader = new FileReader();
                            reader.onload = function () {
                                var id = 'blobid' + (new Date()).getTime();
                                var blobCache =  tinymce.activeEditor.editorUpload.blobCache;
                                var base64 = reader.result.split(',')[1];
                                var blobInfo = blobCache.create(id, file, base64);
                        blobCache.add(blobInfo);

                        cb(blobInfo.blobUri(), { title: file.name });
                    };
                    reader.readAsDataURL(file);
                };

                input.click();
            },
Reply