Tutorial: How to list child nodes on a node relativity parent node page

Node relativity is a simple module which allows you to create connections between nodes, such as between artists and albums, or photos and events. Relationships are created between a parent and child (mathematically speaking, they form a directed graph). I couldn't immediately find documentation describing how to list child nodes on a parent node's page, so I've written this tutorial for anyone else who would like to try this tool.

  1. Install the node relativity module. You'll also have to apply this patch by Village Internet to allow listing of child nodes, since the views integration for version 6.x-1.2 only allows listing parent nodes on child pages, not the other way around.
  2. At Administer » Site Configuration » Node relativity, select two node types which will be involved in these relationships. Under options for the parent type, set Parental Ordinality to "none" and Allowable Child Node types to the name of the other node type. Under options for the child type, set Parental Ordinality to "one or more", and don't select an option from the list of node types which may be used as child nodes.
  3. You can now create relationships on existing nodes. When logged in as a user with appropriate permissions, you'll see a section labelled "Link operations" when viewing a node. In this box, select either "Create new (node type)" or "Attach existing (node type)" to create associations. You'll see a list of child nodes in this box when viewing parent nodes, and vice versa.
  4. Create a node view. Add a relationship of type Node Relativity: Child Node ID, and select the option to require this relationship. Next, add an argument of type Node Relativity: Parent Node ID. Select the relationship "Child Node". This view will be used to publicly display the child nodes of a given parent node. Proceed to select the fields, filters, and other settings as normal. Note that it's not necessary to add a display to the view. You can preview your view by entering the node ID of a parent node into the arguments field of the views live preview tool.
  5. Save this view, go back to Administer » Site configuration » Node relativity, and select the Display settings tab. Under Rendering option for children nodes of type (child node type), select the view you've just created, and save your configuration changes.

You're done! This view will now be used to display child nodes on parent node pages. You can theme it just as any other node.