Attaching info to a relationship
| Project: | Node2Node |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Would it be possible to make the relationship between two nodes require the creation of a node of a certain node type?
For example if I'm modelling something like multiple marriages. A person can have a relation to another person called "marriage". In one direction it would be A is the husband of B and the other direction would be B is the wife of A.
Now, it is fairly common that people have been married more than once. So I would like to have a node created which describes the timeframe of the marriage between A and B. That would be a "Timeframe" node type for this discussion.
The Timeframe node type would be a cck with a start date and an end date.
Now, timeframe would be a rather prolific node type. Used in showing the life time of a person, how long the person worked for company Zzz etc. So, if I create a Timeframe object manually I will have a very hard time to keep track of them...
But, if it could be created (and destroyed) automatically when I say that A is married to B (or A worked at Zzz) and have me fill in the data about the relationship at once, it would be a super duper solution for a lot of data modelling.
This is the kind of functionality which is missing in CCK/Views and any of the hierarchy/relationship modules out there.
It would also remove the neccessity for quite a few special modules (which never do the exact thing you need anyway). See this discussion for more info of other related problems: http://www.darcynorman.net/2008/05/02/creating-a-custom-compound-field-f... My comments are number 24. and 25. which describes the confusion you will end up with in similar cases.

#1
This module creates a new node when a user changes its role. Ie. the node will only be created when the relationship user is member of role: http://drupal.org/project/rolespecific_node
That situation is also handled by the module: http://drupal.org/project/cck_taxonomy which creates cck fields on nodes which are tagged with a certain term. Of course what I suggest is a bit different than both, and more usable for general modelling.
#2
I found this writeup on groups.drupal.org. The intro takes into account some of the things I've talked about in my feature requests: http://groups.drupal.org/node/245
With that in hand I also did some more searches which returned these interesting discussions:
http://groups.drupal.org/node/1966
http://drupal.org/project/relationship <- an 4.7 module which are supposed to be rewritten for d6... Never tried it, perhaps I will dl 4.7 and try it out.
I think I have to make a wiki/book on this :)
This discussion could also be worth to look into is "Everything is a node": http://groups.drupal.org/node/246
And of course the group: http://groups.drupal.org/relationships-site-structuring
I haven't contributed anything (except a few patches) to Drupal, and I wonder about that group existing, and yet there are no finished products... :)
Paul
#3
Hi Paul - I will give this some thought.
Steve