I am trying to create buttons for ckeditor that will add rows and columns of contents to the editor using 960.gs grid system.
I need a way to insert the generated code into certain div that already exists in the editor window not just at the cursor.
For example, We have this code in the editor:
When I click my button, This code is generated:
I need the generated code to be inserted into the div with class (grid_12). Whatever the position of the cursor is.
I need a way to insert the generated code into certain div that already exists in the editor window not just at the cursor.
For example, We have this code in the editor:
<div class="container"> <div class="grid_12"> <div class="inner"> </div> </div> </div>
When I click my button, This code is generated:
<div class="grid_3"></div>
I need the generated code to be inserted into the div with class (grid_12). Whatever the position of the cursor is.
Re: How to insert code inside certain div in ckeditor rather
the title is cut by the forum.
Re: How to insert code inside certain div in ckeditor rather
The answer that they have provided to you at http://stackoverflow.com/questions/8718 ... g-it-at-cu is basically right.
You just have to play with the code a little to adjust it to your needs, but in the end CKEditor is using an HTML document so you can use standard DOM methods to perform any operation that you want.