CKEditor on Advanced Module

edited February 2014 in Modules
I've created advanced modules before and applied the markitup editor fairly easier. Now, how do I get CKEditor to work on a custom advanced module? I could just download it and install it but I'm sure there's a Fuel way...

Comments

  • edited 4:31AM
    In your MY_fuel.php file, you can change your $config['text_editor'] to be 'ckeditor' instead of markitup. Additionally, you can set the "editor" parameter for your form fields on a textarea to be either 'ckeditor' or 'markitup':
    $field['textarea_example'] = array('type' => 'textarea', 'editor' => 'ckeditor');
  • Yes, I'm aware of the configuration file, that works fine for the pages but this is an advanced module using an html field textarea.. I don't even know if CKEditor is being loaded on my advanced module... How do I get it to work on a textarea field?
  • edited 4:31AM
    How is your form being rendered? Is it using the form_fields method from a model or some other manner?
  • I literally just put html and am using jquery to collect the data and make ajax calls. It's an advanced module for editing a description on an employee. It's needs CKEditor.
  • edited February 2014
    Is this form being used in the front end or the backend CMS?
  • It's a backend advanced module that I'm creating to edit data that will be presented on the front end.
  • edited February 2014
    I would recommend using Form_builder to create your form instead of just the HTML and load in the custom form fields in your advanced module's admin controller like so:
    $values = array(); // this would be the saved field values $this->load->library('form_builder'); $this->form_builder->load_custom_fields(APPPATH.'config/custom_fields.php'); $fields['my_ckeditor_field'] = array('type' => 'wysiwyg', 'editor' => 'ckeditor'); $this->form_builder->set_fields($fields); $this->form_builder->set_field_values($values); $this->form_builder->render();
    More on the Form_builder class and its properties you can change here:
    http://docs.getfuelcms.com/libraries/form_builder
Sign In or Register to comment.