Sky
Sky

Reputation: 157

How to click a image form my dialog insert to ckeditor

I using ckeditor to post news and article in my website

I create a plugin function on post page (eg. post_news.php)

that plugin will foreach many images in a JQ dialog.

I want click one image will insert a image to ckeditor mouse cursor postion

< img src"abc.png">

Q1. How to... click a image in a dialog(not ck plugin) to insert a image html code to ckeditor mouse cursor postion

Q2. can I complete this action in the WYSIWYG mode?

Thanks a lot.

Upvotes: 0

Views: 837

Answers (1)

oleq
oleq

Reputation: 15895

Use editor.insertHtml( string ) to insert HTML at the position of the caret:

CKEDITOR.instances.editor1.insertHtml( '<img src="...">' );

And this question is where you'll find how to get the outer HTML of your image.

Upvotes: 1

Related Questions