Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Drupal 6
ckeditor 3.6.4
I have a form element that is returned dynamically via ajax request. I am able to place a ckeditor on it using replace:
CKEDITOR.replace( 'textarea-id');
The problem is that this loads the full toolbar.
I am able to customize the toolbar and plugins programmatically, but this isnt ideal either.
CKEDITOR.replace( 'agenda-text',
{ toolbar: [ [ 'blah']]}
Ideally, I would like to the simplified toolbar as defined in the ckeditor admin pages. How do I access this information? Suggestions are welcome, thank you!
Comments
Comment #0.0
jriggs CreditAttribution: jriggs commentedclarifying post
Comment #1
dczepierga CreditAttribution: dczepierga commentedDo u see any CKEditor setting in the source of the page?
Do u have any editors on the page (loaded without ajax)?
Greetings
Comment #2
jriggs CreditAttribution: jriggs commentedHi, I am using the javascript function CKEDITOR.replace as part of the ajax callback that loads the ckeditor. If I dont call it, then there are not any ckeditors on the page, just a text area.
The problem is (I think) that when I call the CKEDITOR.replace function the settings information is not populated as well. I am posting a couple screenshots that will hopefully show what info I have to work with
'full-page-load.png' shows a normal pages' ckeditor settings fully populated
'ajax.png' shows the same settings if loaded via javascript.
Please let me know any other information that I can provide.
My current solution is to make a database call to retrieve settings data
Comment #3
dczepierga CreditAttribution: dczepierga commented@jriggs, do u try to do sth like this:
I copy this from source of CKEditor module... it possible to get CKEditor settings by AJAX call and then enable it with this settings. It was designed to imagefield ajax calls with editors, but u can also use it...
May be this help you? :)
Greetings
Greetings
Comment #4
jriggs CreditAttribution: jriggs commentedThanks for your help dczepierga, I used a similar approach
Load Configuration Settings On Dynamic Page
Comment #4.0
jriggs CreditAttribution: jriggs commentedtpyos