Add ability to use local image upload in wysiwyg editor
See original GitHub issueI was able to hack it in by modifying wysiwyg additional options
property and fooling keystone to think it’s using cloudinary images but it would be great to have a native way to do that. We’d probably need a destination and flag to decide if we want to hash the name or retain original filename. Can’t come up with easy way to link the images to the document that would use it unless we extended field’s schema to also include additional field for storing image references if user have chosen to use wysiwyg local images
(or whatever it would be called) that would get updated if image is added, removed or would be used to remove images if entry is removed.
Had to create custom api endpoint to handle the uploads - if anybody needed that for the time being let me know. And there goes the hack 😃
keystone.init({
...
'cloudinary config': { cloud_name: 'not', api_key: 'really', api_secret: 'used' },
'wysiwyg cloudinary images': true,
'wysiwyg additional options': {
'uploadimage_form_url': '/api/admin/upload-image'
}
});
Issue Analytics
- State:
- Created 9 years ago
- Reactions:3
- Comments:10 (4 by maintainers)
Top GitHub Comments
@quadrifoliumclover you should check out ConnextCMS. It’s built on top of KeystoneJS and it allows inserting of localy hosted images with the TinyMCE editor.
You can view the source code on GitHub. I ended up having to write a new plugin for TinyMCE.
in answer set header
`
res.setHeader(‘Content-Type’, ‘text/html; charset=utf-8’); res.send({“image”:{“url”:“url you picture”}}); `