使 TinyMCE 图像选择对话框指向 Plone 上的默认文件夹
克隆人 4.1。
使 TinyMCE 图像选择器对话框指向站点默认文件夹(/image-bank)而不是当前文件夹的最简单方法是什么?
这个 + 文件夹显示为相册将为 Plone 轻松提供基本的图像库支持。
我希望为
- 所有 Plone 开箱即用内容类型 (ATContentTypes)
- 实现此功能我的自定义 AT 内容类型
- 我的自定义 Dexterity 内容类型
- Portlet 编辑器 WYSIWYG(是 zope.formlib 吗?)
如果很难编辑 Python 代码在这些地方,只需在客户端修补 TinyMCE 设置的 Javascript 代码片段即可。
Plone 4.1.
What would be the easiest way to make TinyMCE image picker dialog point to a site default folder (/image-bank) instead of current folder?
This + folder display as album would provide a rudimentary image bank support for Plone easily.
I'd hope to achieve this feature for
- All Plone out of the box content types (ATContentTypes)
- My custom AT content types
- MY custom Dexterity content types
- Portlet editor WYSIWYG (is it zope.formlib?)
If it's difficult to edit Python code all over the places, it's accetable just to a Javascript snippet patching TinyMCE settings on the client side.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
米科:真是巧合啊。我只是想实现同样的目标。我设法创建了一个比 更具体的适配器
`产品/TinyMCE/适配器/上传/上传
`。这个新的适配器将上传文件夹(通过设置 self.context )更改为central-images-folder,然后使用中央文件夹图像(以及刚刚上传的图像)更新单选按钮列表(和图像预览) )。这是通过在新适配器中定义
uploadOk
方法来完成的。但是,要更改初始文件夹,我认为唯一的方法是在
skins/tinymce/plugins/ 内自定义
文件夹。但是,更改这两个大文件中的任何一个(将来可能会更改)都可能导致 TinyMCE 的新版本无法适应您的更改。所以你将被迫再次重新定制它们。ploneimage.html.pt
或ploneimage.js
ploneimage我的想法(今天早上我已经通过电子邮件发送给四位数)是通过配置选项为 TinyMCE 提供开箱即用的此功能。这样,包文件将始终了解此功能,并且将来的更改不会损害此新功能。
Mikko: What a coincidence. I'm just trying to achieve the same thing. I managed to create a more specific adapter than
`Products/TinyMCE/adapters/Upload/Upload
`.This new adapter changes the upload folder (by setting
self.context
) to the central-images-folder and then updates radio button listing (and image preview) with the central-folder images (and just uploaded image). This is done by defining anuploadOk
method inside the new adapter.However, to change the initial folder, I think the only way is to customize
ploneimage.html.pt
orploneimage.js
inside theskins/tinymce/plugins/ploneimage
folder. But changing any of these two large files (which might change in the future), could make new releases of TinyMCE not to work with your changes. So you will be forced to re-customize them again.My idea (which I already emailed this morning to Four Digits) is to provide this feature with TinyMCE out-of-the-box, via a configuration option. This way the package files would be always aware of this feature and future changes won't harm this new functionality.