On a site I'm developing, I have a node type with a freetagging vocabulary. Because of the nature of the node, it's probable that a user will add ten or more tags, and possible that they will enter dozens.

The problem: the box is too small! It's a single-line text field with a 255 character limit.

What I want is a multi-line textbox with configurable character limi--something like the freetagging boxes in use on drupal.org's profile pages--e.g., "Interests" under "Personal Information," or "Industries worked in" and "Companies worked for" under "Work." You know--separate with commas or enter one per line.

I've tested several possible solutions, and none of them seemed to work. In each case I get options of radio buttons or checkboxes, or the same dinky little box Modules I've tried:
http://drupal.org/project/content_taxonomy
http://drupal.org/project/formtweaker
http://drupal.org/project/taxonomy_super_select

One other potential solution is only available for 4.7:
http://drupal.org/project/freetagger

I also noted this patch from an earlier version of drupal to increase the character limit from 100 to 255:
http://drupal.org/node/62926
...But, I don't want to go hacking the core just to make one form element for one node type work correctly!

Anyone have any suggestions for me? Is there a way I could get the behavior I want through the theme layer somehow? I'm pulling my hair out here because it's just one little thing that needs to work and I have a whole lot of other work to do on the site, with time pressure.

Comments

xjm’s picture

Also, I tried exploring the code for the cck taxonomy module, but couldn't make heads or tails of where I might patch it to add this functionality.

xjm’s picture

I've tried re-theming the node form to tweak it, but I still run into the character limit on the backend, and even if I theme the input field to be a textarea (which breaks Autocomplete), I still cannot enter one entry per line. (The result of doing so is one big conglomerate term, e.g. "AppleBananaOrangePeaCarrot").

Perhaps this could be an additional widget for Content Taxonomy? An extended freetag box?

Any suggestions are appreciated.

P.S.--It looks like the character limit for the field using Content Taxonomy is even smaller, 128 characters instead of 255.

xjm’s picture

I posted this as a feature request in the Issue Tracker:
http://drupal.org/node/143030

dokumori’s picture

I came across this problem (although I was not using cck content taxonomy field) and found out the limit is set by taxonomy.module. This can be ressolved by creating a custom module and adding the following code to it:

<?php
function your_module_name_form_alter($form_id, &$form){

	if ($form['taxonomy']['tags']){
			$form['taxonomy']['tags'][ x ]['#maxlength']=2047;
		}
	}

}
?>

'x' needs to be a vid which your textbox with autocomplete refers to. you can hard code it or get it dynamically (maybe use regex) to get it from [#autocomplete_path]

Make sure the weight of module contains this code is set to be lighter than Content Taxonomy module. it will not work otherwise.

JonSTeps’s picture

Is this the way drupal.org does this? Could there be a more efficient way of creating multi-line freetagging boxes with taxonomy or cck?