[development] Node referencing

Darrel O'Pry dopry at thing.net
Sun Nov 20 02:53:37 UTC 2005

On Fri, 2005-11-18 at 19:08 -0600, Mark wrote:
> Sergio wrote:
> > Hello, folks,
> >   I'm in need of a little help...
> >   I have a module with 3 types of node. Node A, B and C.
> >   I am trying to do something like A is the main node and B & C 
> > references A. So that, when I show the node A (teaser or full node), I 
> > get some informations about nodes type B and C that makes reference to A.
> >   Also, I want to node types B and C have a reference to the parent (A).
> >   When the user inserts the data, it must be transparent to him as who 
> > the parent is (like there is a link on node type A that allows the 
> > user to create type B or C and the node creation page will not ask the 
> > user who the parent is). The only creation method shoud be like this 
> > for nodes B and C (there should not have a link on the node creation 
> > list. Just for type A)
> >
> >   I took a look at the project module, but I couldn't get much out of 
> > it...
> >   Any help is appreciated...
> >
> > Thanks,
> > - Luis Sergio Moura
> As others have mentioned, there are many modules out there that manage 
> node-to-node relationships.  One thing that was a problem the last time 
> I looked was how to go about restricting access to node/add/[type that 
> requires parent]/[nid of parent] without other things breaking.  
> Previous discussions led me to override the menu settings to disallow 
> access to this path, but since the menu system does not prioritize it's 
> entries, you may find that your modification of the menu permissions 
> doesn't always work.  The result is that the node/add page shows links 
> to add content that is not allowed to exist without a parent. The Node 
> Relativity module (http://drupal.org/node/17004) essentially does what 
> you're looking for, but hasn't been updated in a while.  It is big and 
> needs some refactoring and is probably a heavier solution than you're 
> looking for, though.
> Regards,
> -Mark

Couldn't you handle checking for missing parents with hook_access?

in the if $op == create if there isn't a parent, just theme a page
stating a parent must exist to create this node, and exit?

More information about the development mailing list