Forums

Use JCE editor on text area's in Chronforms 6 form

jj135 21 Mar, 2019
We would like to use the JCE editor on a text area in a CF6 form. We have set the option in CF6 to 'Rich text editor' but I think this produces a CF6 bundled editor. Is there a way to use the edior set in the Joomla CMS? In our case the JCE editor.

Advantages of using the JCE editor: We can create a custom profile for frontend users, even for specific components. That way we can select the editor options / layout that we prefer.

If this is not possible in CF6 at the moment, will the maybe be added as a feature in the near future? Or is there a workaround to get this done?

Kind regards,
Jip
healyhatman 21 Mar, 2019
https://stackoverflow.com/questions/27523066/how-to-add-attribute-name-to-jfactorygeteditor

Try this.
GreyHead 22 Mar, 2019
Hi Jip,

You can use a standard textarea element in your form and then add custom JavaScript to add a different editor to it. There is a FAQ showing how to do this with an earlier version of CF - I think the code for Cfv6 should be very similar.

Bob
jj135 27 Mar, 2019
OK, thanks. I will see if I can find the code and try it.
jj135 27 Mar, 2019
Answer
I got it done this way:

1) Where you want to the JCE editor field to appear: Add a Custom HTML element. (This can also contain PHP)

2) Add this code to the content of the element
<?php
$editor =JFactory::getEditor();
$params = array( 'smilies'=> '0' ,
'style' => '0' ,
'layer' => '0' ,
'table' => '0' ,
'clear_entities'=>'0'
);
echo $editor->display( 'myelementid', '', '', '', '', '', false, $params );
?>
The 'myelement' id will be the data that is passed to Chronoforms and you need to add this to the email that is send (if you use that action).

(Not sure what the paramaters do exactly and maybe you can leave this empty, but I have not tried that. You can configure the editor settings in the JCE component)

In JCE: Make sure you have an active profile for the frontend!

(In our case we created a custom profile in JCE for the frontend for the CF component only.)

Hope this helps other with the same question.
This topic is locked and no more replies can be posted.