如何在tinymce中嵌入图像?
Tinymce 允许您通过引用 url 添加图像。对于普通用户来说,他们可能甚至不知道 url 是什么,这太乏味了。他们的计算机上有一个图像,并且应该将其嵌入到 html 文本中。有没有一种简单的方法可以使用tinymce来实现这一点?
文件上传插件在这种特定情况下没有帮助,因为tinymce编辑器在本地运行。图像确实需要嵌入到 html 文本中。
Tinymce allows you to add an image by refering to an url. For a normal user, who probably does not even know what an url is, this is too tedious. They have an image on their computer, and it should be embedded in the html text. Is there a straightforward way to achieve this using tinymce?
A file upload plugin would not be helpful in this particular instance, because the tinymce editor runs locally. The image really needs to be embedded in the html text.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我创建了一个在这里找到的插件( https://github.com/buddyexpress/bdesk_photo )
有插件中的一些限制如下:
I have created a plugin its found here ( https://github.com/buddyexpress/bdesk_photo )
There are some restrictions in plugin like:
您需要确保在tinymce init中valid_elements和valid_children配置正确。您希望用户如何嵌入图像? (按钮单击,拖放,...)
要为每个tinymce API插入图像,您可以使用:
我强烈建议您下载tinymce开发人员版本并仔细查看文件tiny_mce/themes/advanced/editor_template_src.js和tiny_mce/themes/advanced/charmap.html。如果可能的话,在源代码中搜索“charmap”。
您必须插入图像 html 代码,而不是插入字符。
You need to make sure that in the tinymce init valid_elements and valid_children are configured correctly. How do you wish the user to embed the image? (buttonclick, drag-and-drop,...)
To insert an image per tinymce API you can use:
I strongly suggest you download the tinymce developer version and have a closer look at the files tiny_mce/themes/advanced/editor_template_src.js and tiny_mce/themes/advanced/charmap.html. If possible search the sourcecode for "charmap".
Instead inserting a character you will have to insert the image html code.