user3585448
user3585448

Reputation: 17

TinyMCE + Filemanager: browse button doesn't work

I wanted to implement filemanager + tinymce editor on my webpage. Problem is that browse button is not working when clicked. Maybe I miss something? This is my code:

tinymce.init({
    selector: "#pre_text",
    theme: "modern",
    height: 300,
    subfolder:"",
    menubar: false,
    plugins: [
         "advlist autolink link image lists charmap print preview hr anchor pagebreak",
         "searchreplace wordcount visualblocks visualchars code insertdatetime media nonbreaking",
         "table contextmenu directionality emoticons paste textcolor filemanager"
    ],
    image_advtab: true,
    file_browser_callback: true,
    toolbar: "undo redo | bold italic underline | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | styleselect forecolor backcolor | link unlink anchor | image media | print preview code"

});

Upvotes: 1

Views: 1077

Answers (1)

jayarjo
jayarjo

Reputation: 16756

First of all there's no filemanager plugin bundled with TinyMCE. So unless you have one from another source (or written by yourself), you got to remove that from your plugins list, or it will break your config. There's MoxieManager plugin that is sold separately, but that's whole different story.

Also setting file_browser_callback to true (it is a deprecated option btw, use file_picker_callback instead), obviously doesn't really do anything. It will only show a dummy browse button in the corresponding dialogs.

So you basically have two options: you can purchase MoxieManager add-on, or write a basic file picking function yourself and pass it to TinyMCE, via: file_picker_callback.

For self-implemented file picker, check an answer here for example: https://stackoverflow.com/a/37395883/189673.

Upvotes: 0

Related Questions