How can I remove taxonomy select boxes from the add node form for a couple of content types? (not from the edit form page though)

Users shouldn't be able to select taxonomy when creating a node.

Is it possible?

Comments

coreyp_1’s picture

The only way I can think of to keep the taxonomy on the edit pages, but not on the creation pages, would be to write your own module that would make use of hook_form_alter() to hide the taxonomy form when a node is being created. That way, you don't have to hack any core files.

- Corey

Z2222’s picture

Thanks, I will look into it.

kabaman’s picture

i would like to hide the taxonomy-select not completly remove it
i tried to change the taxonomie-select-field

to an hiddenfield like this:
<?php
function blog_form_alter($form_id, &$form) {
  if($form_id =='blog_node_form'){
    $form['taxonomy[9]'] = array('#type' => 'hidden','#value' => 'blog');
  }
}
?>

but it doesent work
probably because of that strange "[9]"
without it the field it changes to an hidden formfield but then of course my field has the wrong name

well. i also can unset the field with unset($form['taxonomy'])
and then create the hidden version
$form['taxonomy[9]'] = array('#type' => 'hidden','#value' => 'blog');
but then the term is not getting set

why ?