Whenever there is more than 1 taxonomy for a content type, the taxonomy will be showing inside a js fiedset which call 'Vocabularies'.
I don't know where I can change this title of 'Vocabularies' or where can disable this fieldset ?
I prefer the taxonomy not showing inside the fieldset .

Thanks

Comments

skizzo’s picture

I guess there are better ways, but the formdefaults module (10 KB) would allow you to customize the fieldset label.

francewhoa’s picture

Same here. Other options are:
'Formfilter' module at http://drupal.org/project/formfilter

'String Overrides' module to edit the fieldset label 'Vocabularies'. http://drupal.org/project/stringoverrides

'Jammer' module to remove or hide other parts of forms at http://drupal.org/project/jammer

Loving back your Drupal community result in multiple benefits for you  
Chris Einkauf’s picture

Follow the steps on this page that I just wrote: http://drupal.org/node/561078

skizzo’s picture

Thank you Chris! How would you apply a specific name based on Content Type? E.g.: Story Categories, Page Vocabularies, etc...
Also, would it be possible to remove the fieldset alltogether (often it does not add anything meaningful to the form really...)?

Chris Einkauf’s picture

To apply a specific name based on content type, you would edit the code in vocabularies_fieldset_to_categories_fieldset.module so that it's similar to the following:

<?php
//In this example, the module basically says "if the content type is "forum" and the title of the fieldset is "Vocabularies", then change the title of the fieldset to "Forums".  You can also copy the whole if statement so that you have 2 different if statements, with one checking if the content type is forum and the other checking if the content type is some other specific content type you've created.

function change_vocabularies_fieldset_name_form_alter(&$form, $form_state, $form_id) {
 
	if(($form['type']['#value'] == 'forum') && ($form['taxonomy']['#title'] == 'Vocabularies')) {
		//In the line below, set the name of the Vocabularies fieldset
		$form['taxonomy']['#title'] = 'Forums';
	}
 
}

As far as removing the fieldset altogether, you have a couple options (maybe more)...
A) you could uncheck the content type from the vocabulary's settings at admin/content/taxonomy
B) you could set the #access to 0 via an additional line in the custom module, or in that content type's template file (like a file named mycontenttype.tpl.php if your content type is called 'mycontenttype').

If you decide to go with option B, and decide to do it by putting an additional line in the custom module, the module's code could look like this:

<?php
//In this example, the module basically says "if the content type is "forum" and the title of the fieldset is "Vocabularies", then change the title of the fieldset to "Forums".  It then also says "if the content type is "mytype" then don't display the taxonomy fieldset.

function change_vocabularies_fieldset_name_form_alter(&$form, $form_state, $form_id) {
 
	if(($form['type']['#value'] == 'forum') && ($form['taxonomy']['#title'] == 'Vocabularies')) {
		//In the line below, set the name of the Vocabularies fieldset
		$form['taxonomy']['#title'] = 'Forums';
	}

	if($form['type']['#value'] == 'mytype') {
		//In the line below, set the name of the Vocabularies fieldset
		$form['taxonomy']['#access'] = '0';
	}
 
}
johnhanley’s picture

I prefer the taxonomy not showing inside the fieldset .

I recently wanted to suppress the taxonomy fieldset on a node form and simply did the following:

function mymodule_form_alter(&$form, $form_state, $form_id) {
  if ($form['type']['#value']) == 'story') {
    unset($form['taxonomy']['#type']);
  }
}
mahnster’s picture

I do believe the OP was wanting to MOVE the taxonomy selectors OUT of the fieldset, not disable the whole thing. He didn't want it in a collapsible fieldset, but each one its own. I want this too as I might have a Taxonomy that is "Service Type" and then another Taxonomy for Country/City. I'm sure there is a way to move stuff around in this form_alter function?

johnhanley’s picture

It's been almost a year since my post and I forget what my objective was at the time, but I do understand the OP's original intent. It's possible I wanted more control of where the taxonomy field appeared and simply copied the form element, unset the fieldset and moved the field where needed.

So yeah, what you ask should be perfectly doable. You just need to examine the $form array and proceed.