Hi, I need to create relations between nodes of two different content types. The most natural thing to use basing on my knowledge about drupal is nodereference.
However it lacks a feature that I would need.
When I reference a node I'd like to be able to choose an attribute to describe the relationship.

Let's say I have an Events and People acting in this event. Maybe one is a speaker, another one is a guest and so on.

So I would like to have a CCK field with two field acting as a pair. One for the referenced nid and the other for the attribute (by example to be chosen from a preset dropdown list, or a taxonomy).

This way, when displaying the Event node I would have a way to group similar child nodes.

Is there any module to accomplish this?

Thank you for any help.

GP

Comments

dooug’s picture

Could you just have multiple nodereference fields, one for speaker and one for guests (this one would be set to unlimited or multiple values)?

Or check out this handbook page, it might give you a few leads on useful modules: http://drupal.org/node/645798

Also, I'd take a look at http://drupal.org/project/nodehierarchy

Others might also be:
http://drupal.org/project/relativity
http://drupal.org/project/noderelationships

Also, be sure to do your homework and search a bit yourself first! http://drupal.org/forum-posting#homework

gp.mazzola’s picture

Hi doug,
thank you for the answer.
I did search the handbooks pages and find the modules you are suggesting, but no one seems to satisfy my needs. I had a similar situation before and I ended up doing it the way you suggest in your first sentence. So a different (multiple) nodereference field for every relation type.
But I think it's not such an optimal solution. It's rather strange that with the plenty of modules that are here, there is no one to solve a task that I think is very common, that is binding an attribute to a relation.

What nodereference does is associating in a table a node nid with the referenced node nid. So basically it would be adding a column to nodereference table, to store the attribute.
In short something like

| referencing nid | referenced nid | relation type |

Maybe with "relation type" being a pre-populated select list configured at field definition settings.

Ok, then I think in the future I'll have to write down my module

GP