Add support for freetagging taxonomy fields in CCK content types please.

Checking '#autocomplete_path' is set, is a start, and then seeing if the path it points to include ''content_taxonomy' should identify the field as being suitable.

CommentFileSizeAuthor
#11 add_suggested.patch1.55 KByan

Comments

zmove’s picture

I would love to see this feature too. Content taxonomy is a must have.

Crell’s picture

Patches would be welcome. I have no bandwidth to work on this myself.

Witch’s picture

that would be great!

subscribe

skizzo’s picture

after moving all of my tags to CCK content_taxonomy fields
in Drupal 6, I could not use Suggested Terms any more :-(
I hope someone can implement CCK support.
Subscribing.

ksc’s picture

Subscribing. It would be great if Suggested Terms would work with CCK Content Taxonomy.

Crell’s picture

Project: Suggested Terms » Content Taxonomy
Version: 5.x-1.x-dev » 6.x-1.x-dev

That would probably be best done as a new widget in CCK Content Taxonomy. It has no relation to the taxonomy UI, which is what this module does. An implementation for Content Taxonomy would likely duplicate most of the functionality here, including the Javascript.

I'm bouncing this over to Content Taxonomy as it has no bearing on Suggested Terms proper.

Crell’s picture

Title: Support CCK content_taxonomy fields » Support Suggested Terms-style widget

And a better title so the Content Taxonomy maintainers know what we're talking about... :-)

esmailzadeh’s picture

Assigned: Unassigned » esmailzadeh
Status: Active » Patch (to be ported)

apply this patch:
add these lines after line 187 below of
( array_unshift($element[$field_key]['#element_validate'], 'content_taxonomy_autocomplete_validate');
)
in content_taxonomy_autocomplete.module file:

   if(module_exists(suggestedterms)){
	  $sort_order = variable_get('suggestedterms_sort_order', SUGGESTEDTERMS_SORT_NAME);
      switch ($sort_order) {
        case SUGGESTEDTERMS_SORT_POPULAR:
	      $tag_description = 'Most popular terms';
          break;

        case SUGGESTEDTERMS_SORT_RECENT:
          $tag_description = 'Recently added';
          break;

        default:
          $tag_description = 'Terms by name';
          break;
      }
	    $path = drupal_get_path('module', 'suggestedterms');  
    drupal_add_js($path . '/suggestedterms.js');
	$element[$field_key]['#description']="<br />\n". t($tag_description) . ': ' .	_suggestedterms_build_suggestions($element['#vid'], $sort_order);
}

Crell’s picture

Status: Patch (to be ported) » Active

That is not a patch. See http://drupal.org/patch/create

AntiNSA’s picture

Anyone tried this?

yan’s picture

Status: Active » Needs review
StatusFileSize
new1.55 KB

Here's a patch. I not very experienced with making patches, so please tell me if something is wrong. I created it from the module directory, not the Drupal root.

For me it works, but when I change the suggested terms settings to "Most recently added", I get an error message:

user warning: Unknown column 'nt.tid' in 'on clause' query: SELECT t.name AS name FROM term_data t LEFT JOIN term_node tn ON (t.tid = nt.tid) WHERE t.vid = 3 GROUP BY t.name ORDER BY t.tid desc LIMIT 0, 5 in /<drupal-root>/sites/all/modules/suggestedterms/suggestedterms.module on line 98.

But it seems to be a problem of the suggested terms module, not the patch.

esmailzadeh’s picture

if you use a source control client, this made patch automatically for you