0

I have a problem with insert image popup. The popup opens, but I can't see the browse button so I can't upload an image from frontend. What can be the problem?

On phtml i have used below jquery to open tinymce popup.

require([
    'jquery',
    'mage/adminhtml/wysiwyg/tiny_mce/setup'
], function (jQuery) {

    var config = {},
            editor;
    jQuery.extend(config, {
        settings: {
            theme: 'advanced',
            theme_advanced_buttons1: 'bold,italic,|,justifyleft,justifycenter,justifyright,|,' +
                    'fontselect,fontsizeselect,|,forecolor,backcolor,|,link,unlink,image,|,bullist,numlist,|,code',
            theme_advanced_buttons2: null,
            theme_advanced_buttons3: null,
            theme_advanced_buttons4: null
        }
    });
    editor = new tinyMceWysiwygSetup(
            'short_description',
            config
            );
    editor.turnOn();
    jQuery('#short_description')
            .addClass('wysiwyg-editor')
            .data(
                    'wysiwygEditor',
                    editor
                    );
});

1 Answer 1

0

you need add media or image to your theme_advanced_buttons option.

Example:

theme_advanced_buttons2: 'media,image'
4
  • No, I want a browse button which is visible in admin but not on frontend. Dec 6, 2018 at 10:06
  • I don't understand your mind, can you explain more?
    – Ronald Do
    Dec 7, 2018 at 7:46
  • When we try to add wysiwyg editor on frontend, it will not allow to upload images in wysiwyg as frontend user does not have permission. So, for now I have override the image.htm file from tiny_mce lib and added my custom popup to upload image. Is there any other way to do this in correct way? Dec 21, 2018 at 5:48
  • sorry, I never try on frontend, I will try and if I can, I will update later
    – Ronald Do
    Jan 4, 2019 at 7:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.