I'm looking at implementing a site with the following node types:
- person
- department
- project
- publication
Relationships need to be established between most of these - like in a person listing, you should be able to see/edit the departments he belongs to, the projects he's working on and publications that include his name as an author. Similarly, a department listing should be able to show the people in the department, the projects in that department, and the related to that department (which may be different to the total publications list of the people in the department. The same is true of projects, and of publications.
Then in addition, I'd like to be able to tag posts to belong to a project, and implicitly a person via authorship. (I'm thinking the NAT module may help out here.)
I'd look to node relativity, but this is a symmetric structure, and not hierarchical. Similarly node references in CCK are directed (but getting close to a fit). Organic groups had some of the concepts that I was after, but just turns to a mess when getting to the specifics. Essentially,
I think I want to maintain a link table in the database like:
- node_type_a
- node_type_b
- nid_a
- nid_b
- weight_a
- weight_b
where elements of this table can be created by editing either a or b, and are automatically deleted if either a or b is removed. (Some constraint would be imposed like node_type_a
What is the right way of doing this? Am I heading down the right track, or is there a completely different way I should be approaching it?
Comments
Rest of the post....
where elements of this table can be created by editing either a or b, and are automatically deleted if either a or b is removed. (Some constraint would be imposed like node_type_a < node_type_b to resolve the ordering ambiguity). I'm expecting access would require adding a CCK field to node_type_a and to node_type_b. There would also have to be some way of creating the table in the first place
What is the right way of doing this? Am I heading down the right track, or is there a completely different way I should be approaching it?
Similarly node references in
This is true, but you can easily traverse the link backwards using an argument to a view. With a little php you can embed a view on a node showing the other nodes which refer to the given node.
------------------------------------
Ronan - Gorton Studios - http://www.gortonstudios.com/
------------------------------------
Ronan
Founder - NodeSquirrel - https://www.nodesquirrel.com/
Agency Tools Lead - Pantheon - https://www.pantheon.io/
True, I could get most of it
True, I could get most of it hacked up that way. As far as I can tell though, it still means only being able to edit the association from one side, and having two different code types for the same task.
That's true. If you're
That's true.
If you're comfortable writing php, it would be a pretty simple task to update back-links on save with a small custom module. I do not know of a contributed module which already does this, but it wouldn't hurt to look I guess.
------------------------------------
Ronan - Gorton Studios - http://www.gortonstudios.com/
------------------------------------
Ronan
Founder - NodeSquirrel - https://www.nodesquirrel.com/
Agency Tools Lead - Pantheon - https://www.pantheon.io/