For Drupal7, we can possible deprecate this module. Instead of a term_node table, D7 stores term affiliations in Field storage. I think we can safely say that $delta=0 is the primary term.
What we might need is a dedicated widget (aka form element) which makes it clear and easy for editors to pick multiple terms and choose one as primary. Food for thought:
http://drupal.org/project/multiselect (a widget)
http://drupal.org/project/content_taxonomy (works with a variety of widgets)
Also, an upgrade path to field storage would be ideal. I guess it would run after the core upgrade to field storage and would fiddle with $delta values.
Comments
Comment #1
brianV commentedPerhaps I am wrong... but the module will need tor remain, even just to provide an upgrade path to the D7 field storage.
I assume this could be as simple as a loop that does something like the following for each nid / vid with a primary term:
This would force the primary term to $node->taxonomy[0];. Following which, our widget could handle the rest and we could get rid of the database storage.
At the same time, this draws the assumption that no other contrib module cares about the position of a term in the taxonomy array; if another contrib module did, then these would conflict.
Comment #2
spearhead93 commentedFor a widget, I've implemented primary terms with jquery-asmselect: http://code.google.com/p/jquery-asmselect/. It works great and gives a good UI for end-users.
Primary term is the first one dragged at the top and is highlighted.
I'll investigate if it degrades better or not than multiselect.
Comment #3
gooddesignusa commentedspearhead93 any chance you could zip up the code so others can play around.
Comment #4
Taxoman commentedComment #5
cimo75 commentedHi
I am interested in this one too, any news for D7?
tx
Simone
Comment #6
Katrina B commentedRelated question: In D7, is it possible to set one Taxonomy term as the "primary term" -- so that if a node has several Taxonomy terms (in the same category) assigned to it, the desired one is used as part of the node's path or URL? (That would be my main reason for wanting a D7 version of Primary Term.)