Nicedit configuration

Dear Steph,

For some forms, I would like to give very few rich text editing options to my users.

It turns out that nice edit is highly configurable; do you think you could add a “config options” sub field for rich text/ use nice edit fields in a future version of formidable pro?

http://wiki.nicedit.com/w/page/515/Configuration%20Options

Or could you give me some directions to achieve this (to be able to configure nice edit for a specific field) with a plugin?

Thanks.

There's a hook in the javascript for the editor.

add_action('frm_rte_js', 'add_nicedit_opts');
function add_nicedit_opts($html_field_id){
  //the html_field_id is "field_FIELDKEY"
  echo ",buttonList:['bold','italic']";
}

Ok thanks. Just to be sure I understand correctly:

1. Can this go into a plugin?
2. If my field has an id of 345, what would be the code? I am not sure I understand your comment line.

Tnx.

Anytime you add custom code, it will go in a new plugin or your theme functions.php.
If you want to limit the buttons on all of your rich text fields, you don't need to use the field key at all. If you do only want this to apply to one field,

add_action('frm_rte_js', 'add_nicedit_opts');
function add_nicedit_opts($html_field_id){
  if($html_field_id == "field_FIELDKEY") //change "FIELDKEY" to the field key for this field, not the ID
     echo ",buttonList:['bold','italic']";
}

Hi Steph. I was confused by your " There's a hook in the javascript" comment, that's why I asked. My bad.

Is this supposed to work for an "edit an entry" too? It does nothing to nice edit.


/*
Plugin Name: niceditcfg
Description: config nice Edit tool bar
Version: 0.000000001
Author: Michele Capurso
*/
add_action('frm_rte_js', 'add_nicedit_opts');
function add_nicedit_opts($html_field_id){
//the html_field_id is "field_FIELDKEY"
echo ",buttonList:['bold','italic']";
}

Please refer back to the options you linked to above.

echo ",fullPanel:false,buttonList:['bold','italic']";

Yes! As usual, thank you very much!

Michele

Topic closed.