How to use url image inserting dialog instead of upload in CKEditor 5 Classic - ckeditor

I want to use CKEditor 5, insert image with URL dialog, instead of its default file upload dialog. how to do this in CKEditor 5 Classic?

There is, as far as I know, no such feature officially provided.
There is, however, a tutorial provided in the documentation on how to write such a feature: https://ckeditor.com/docs/ckeditor5/latest/framework/guides/creating-simple-plugin.html
There is also a separate project on github for the same purpose, which appears to be a bit more stylish: https://github.com/khanhna/ckeditor5-image-via-url
Both approaches require to configure a modified build, and both appear to lack an important component: a button in the image's toolbar to edit that URL later on.
So, a more simple approach that does achieve practically the same is to just drag the images into the editor from some browser window.

Related

CKEditor multiple iframe dialog fields show the same dialog

I have created two CKEditor plugins. Each of them uses an "Iframe Dialog Field", meaning that a dialog box is launched and the contents of that dialog box is a webpage (you can think of the entire dialog box as being like one big iframe).
Each plugin works perfectly on its own. However if I use both plugins in the same CKEditor app, they both end up displaying the same page, rather than two different pages, despite the fact that they point to two different pages. I see no reason why this should be happening. Does anyone know how to prevent this?
To make sure there is no confusion, an "IFrame Dialog Field" is a dialog box whose contents are another webpage.
Documenentation - http://ckeditor.com/addon/iframedialog
[ This is different from using an "IFrame dialog", which I believe is a plugin that lets the user add an iframe to the page.
Documentation - IFrame Dialog: http://ckeditor.com/addon/iframe ]
In terms of usage, when using an IFrame Dialog Field, you specify the url of the page to load in the addIframe() command. Here is an example of using a CKEditor Iframe dialog
https://gist.github.com/garryyao/1170303
Back to my issue - if I use just one of the plugins in my CKEditor, it works perfectly. Each plugin points at a different url, and opens that url as the contents of the dialog box. But, if I use both plugins in my CKEditor, although I see a different icon for each, both end up launching a dialog box which points to the same url. Depending which one I launch first, that is the url both end up opening. It is as if you are only allowed to use one IFrame Dialog Field in CKEditor, and the first one used overwrites all others.
This same question was asked a couple of years ago, with no response on the CKEditor forum. The person who asked the question posted his solution, or rather his workaround, which was to NOT use the IFrame Dialog Field altogether, but to instead use a regular dialog and then put an iframe element within it.
http://ckeditor.com/forums/CKEditor-3.x/multiple-iframedialog-plugins-display-same-dialog
That seems like an OK workaround, but it is a workaround and not a solution. I haven't tried it yet, and don't know what potential issues I will run into if I go down that route. I'd prefer to fix my existing code rather than rewrite the plugins, unless I have no choice.
Any help would be appreciated.
Since I have not found any further information, or received any answers here, I ended up going with the workaround mentioned at the end of my question - I used a regular dialogue box and put a big Iframe within it. This problem doesn't exist with that approach, and It looks pretty much the same as an Iframe dialog box. (Considering the almost total lack of community support with CKEditor customization, I've realized it is better to just adjust your design/concept to do what is more easily accomplished with CKEditor, rather than get CKeditor to do exactly what you want).

How to add RichText editor to a page as component in HippoCMS?

I'm creating some project using HippoCMS 10 and I need to add RichText editor as part of the page, so that customer can use it and fill something there. This editor must act exactly the same way as in Document Editor (customer can click Image button in toolbar and select image from ImagePicker dialog box).
Can't find anything about it in HippoCMS official documentation. I learned how to create custom plugins and how to integrate CKEditor into page separately, but for image picking, I need default behaviour as in Hippo.
How can I achieve this? Any help will be appreciated!
I think your question was answered on the community group. The answer there was:
"it should be quite easy to have a CKEditor in the website.
However, it doesn't really make sense to me to have site visitors able to pick CMS documents and images from the site. The picker dialogs are designed to work inside the CMS only. You should be able to create your own picker dialog that can read from a REST service that exposes the images/documents.
I don't think it will be possible to reuse the CMS picker dialog in the site."
and
"your use case is fine, when I said "it doesn't really make sense", I was really referring to the technical limitations of the pickers. You should be able to achieve what you want with a custom dialog that plugs into a REST service though. Unfortunately there is no quick solution for this that I can think of."
Just adding this for future reference.

How to perform Preview in CKEditor

I am using CKEditor to get HTML from the user. The user will use HTML tags and it will be saved in the database. I need a functionality for the user to see how the page will be displayed when open as .html before saving in the database.
Is it possible to do that using CKEditor and if yes.....then how?
Thanks-in-Advance
It's certainly possible, but depends a lot on your specific requirements.
Get the contents of the editor using editor.getData(), then open a pop up window displaying that content - this should be relatively simple with JavaScript so I won't give any examples - you'll have to try it yourself first :). If a pop up is not something you want to use, maybe use an inline dialog, such as the ones that jQuery uses.
I would create the workflow so that the preview box has a save button inside it, forcing the user to preview before saving. If that's not acceptable, then create a separate button on your page to do the preview.

Making TinyMCE image pick dialog point to a default folder on Plone

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.
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 an uploadOk method inside the new adapter.
However, to change the initial folder, I think the only way is to customize ploneimage.html.pt or ploneimage.js inside the skins/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.

Ajax Image gallery / Open, Close Window Effect

Can anyone point me in the direction of such a script? It should also be able to work when called into another ajax window. This is the type of gallery i am going for:
http://dageniusmarketer.com/DigitalWonderland/pages/DemoGalleryExample.html
It should go on this page:
dageniusmarketer.com/DigitalWonderland/
Portfolio section.
This script should be real simple to use with minimal extra files to make it work. I also should be able to just drop images in a gallery folder and it populates the gallery automatically with thumbnails....I shouldnt have to write code for each image in my html. Should be all dynamic.
I also would like to know how I could go about a window effect where every time I open up a new section via my navigation, the window shrinks closed with the old content, then expands open with the new content. the window effect should be vertical (top to bottom shrink into center, expand from center top to bottom)
Please Let me know. Thanks
JQuery is one of my personal favorite javascript libraries (along with 99% of this site apparently!)
But it will have a learning curve, as your requirements seem pretty specific, and you will have to read some documentation to pull it off.
Try Spry from Adobe. They have a very similar demo. Also, the other common frameworks for this would be prototype/scriptaculous, dojo, mootools, jquery. In many cases they have extensions that would provide the exact thing you are looking for. For example, try
shadowbox extension which is framework agnostic. Best of luck!
Imago looks promising:
http://imago.codeboje.de/
Just discovered the very awesome-looking jQuery Tools library today. Meets your "simple and minimal" requirements and could probably pull off what you've sketched, with just the "tooltips" and "scrollable" components.
I also should be able to just drop images in a gallery folder and it populates the gallery automatically with thumbnails
My instinct is that you'd be better off writing server-side code to handle this part of your requirement.

Resources