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
);
});
Shashank Kumrawat
2,12824 silver badges61 bronze badges
1 Answer 1
you need add media or image to your theme_advanced_buttons option.
Example:
theme_advanced_buttons2: 'media,image'
-
No, I want a browse button which is visible in admin but not on frontend.vikas mehar– vikas mehar2018年12月06日 10:06:11 +00:00Commented Dec 6, 2018 at 10:06
-
I don't understand your mind, can you explain more?Ronald Do– Ronald Do2018年12月07日 07:46:36 +00:00Commented 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?vikas mehar– vikas mehar2018年12月21日 05:48:04 +00:00Commented Dec 21, 2018 at 5:48
-
sorry, I never try on frontend, I will try and if I can, I will update laterRonald Do– Ronald Do2019年01月04日 07:45:46 +00:00Commented Jan 4, 2019 at 7:45
default