【问题标题】:How to add browser file or image button in Tinymce如何在 Tinymce 中添加浏览器文件或图像按钮
【发布时间】:2016-07-11 12:25:24
【问题描述】:

我在我的 php 文件中编写了以下代码。我有图片选项,但要上传图片我需要添加 URL

tinyMCE.init({
        // General options
        mode : "exact",
        elements : "descp",
        theme : "advanced",
        plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount",

        // Theme options
        theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
        theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
        theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
        theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
        theme_advanced_statusbar_location : "bottom",
        theme_advanced_resizing : true,

});

执行时我没有获得浏览文件选项

【问题讨论】:

    标签: php tinymce tinymce-4


    【解决方案1】:

    您可以使用外部插件将图像/媒体上传到 tinymce。 openmanager 是用于图像/媒体上传的工作插件之一。

    试试这个 https://github.com/rmorse/Open-Manager

    【讨论】:

      【解决方案2】:

      将这些论点与其他人一起添加

          tinymce.init({
          selector: 'textarea',  // change this value according to your HTML
          file_picker_callback: function(callback, value, meta) {
      
         // Provide image and alt text for the image dialog
         if (meta.filetype == 'image') {
           callback('myimage.jpg', {alt: 'My alt text'});
         }
      
      
        }
       });
      

      【讨论】:

      • 仍然没有得到浏览按钮
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-10-24
      • 2011-09-06
      • 2012-05-07
      • 1970-01-01
      • 2016-04-26
      相关资源
      最近更新 更多