1

I am using drupal 7 version with in place editing module editablefields I was able to hide the text format options in edit mode with simplify module but in node view mode are still there.

Please, do you have any module or custom module with hooks that I could use or do? !

3 Answers 3

2

You can find multiple questions/answers to this problem in this site... One of the most recommeded approach is using hook_form_alter hook: example:

function MY_MODULE_OR_THEME_form_alter(&$form, &$form_state, $form_id) {

  // dpm($form);
  // dpm($form_id);

  if($form_id == 'MY_NODE_FORM_ID') {
    $form['#after_build'][] = 'custom_my_node_form_after_build';
  }
}

function custom_my_node_form_after_build($form) {
  // dpm($form);
  // Find the right field's format option with dpm() function

  $form['MY_FIELD']['und']['0']['format']['#access'] = FALSE;
  return $form;
}
1
  • But with hook_form_alter I can modify the edit tab, but I want to hide these options in node_view where a certain field is editable (I am using FULL html, the filtered is disabled)
    – krasobko
    Mar 31, 2014 at 12:56
0

You can disable text formats from this page admin/config/content/formats

1
  • I want to use Full HTML, the filtered HTML is disabled
    – krasobko
    Mar 31, 2014 at 12:57
0

As mentioned above you can do this task by various way....

  1. See the screenshot of display setting and make it plain. enter image description here

  2. Use hook_node_view or template_preprocess_page or template_preprocess_node_page and just unset the format key of an array $var.

1
  • Hi, Thanks but I cannot do the first way because in this field I choose the added by this module "editablefields" the field to be editable, so I cannot choose both in this dropdown shown above
    – krasobko
    Apr 1, 2014 at 20:17

Not the answer you're looking for? Browse other questions tagged or ask your own question.