How to target and remove a given fieldset within drupal

502 Views Asked by At

I am very new to drupal and have been playing around with lots of different modules and core features. I have now come to an issue I have been trying to solve for the pass 48hrs without finding the right solution.

I am building a forum, using the core module, but my problem is when users post a new topic / comment, they are given the option of selecting which 'text format' they want to use. I want drupal to take it as given that filtered HTML is the only option and not offer the use a 'plain text' format.

I can just target the fieldset's id with 'display:none' in CSS and that does work, will not display any more, but I would like to know how to remove the fieldset code itself.

I have tried this,

function THEMENAME_form_alter(&$form, $form_state, $form_id)  {
unset($form_id('edit-body-und-0-format');
 } 

The 'edit' id is the id on the fieldset for the text options, but all this does is give me the white screen of death....

So what I am doing wrong?

Many thanks for any help given....

Glenn.

1

There are 1 best solutions below

1
On

You don't need to do this with code, you can do it via the admin interface, in Drupal 7 do this:

Go to: Configuration->Content Authoring->Text formats Turn off the formats for the roles.

If you are using a wysiwyg editor you can also change it per profile go to: Configuration->Content Authoring->wysiwyg profiles