Form_Builder with wysiwyg field on public side
Hi
I've created a public-side form using form_builder and it displays after a $this->form_builder->render();
I want one of the fields to be a CKEditor box so I've set
$fields['my_comment'] = array('type' => 'wysiwyg', 'editor' => 'wysiwyg');
However this still just displays a standard textarea.
I understand that I need to manually include a variety of other bits on my page for it to work. I currently have:
echo js('fuel/custom_fields','fuel');
echo $this->load->module_view(FUEL_FOLDER, '_blocks/fuel_header_jqx', array(), TRUE);
echo js('jqx/jqx', 'fuel');
echo js('fuel/fuel.min', 'fuel');
...but it's still not working.
Does anyone have a fool-proof definitive setup for doing this?
TIA
Comments
$this->form_builder->load_custom_fields(APPPATH.'config/custom_fields.php');
If you are needing a wysiwyg editor for the front end, you may be able to simplify all the javascript some because it won't need to do things like protect templating syntax, use the fuelimage and fuellink plugins or use the markItUp! editor when viewing source like it does in the CMS. I'd recommend creating your own custom field perhaps that does this. Here are some examples of how to do that.
http://docs.getfuelcms.com/general/forms#association_parameters
http://www.getfuelcms.com/blog/2013/12/17/creating-a-color-picker-custom-field
http://www.getfuelcms.com/blog/2014/06/04/integrating-with-dropbox
You're probably right with regard to simplifying. I'll look into it...