Overview

Node Collection is a module that will allow you to add parent child relationships on different content types and will help you to create content rich small micro sites inside your Drupal 7 installation.

Once you define a parent-child relationship and if you create a parent node, the module will add admin links to create or edit child nodes and vice versa on each node edit page bounded within the relationship. This will make it very easy for a content editor to manage the content among the relationship instances.

Once you have created the parent node and the child nodes associated with it using the admin links on the top of each parent or child content type edit page, you will have the following set of features/abilities enabled per relationship instance basis.

  • A menu item will be created automatically to link up the parent and the children together for each relationship instance.
  • The generated menu will be rendered on theme $title_prefix template variable horizontally so that it will provide you with a small browsable microsite when a user visit any of the parent or child node instance.
  • Relative paths for the children will be automatically generated (If the parent path is http://example.com/parent the child path will be http://example.com/parent/child) if the Path Auto module is enabled (optional).
  • Template suggestions will be added based on the relationship so that you can theme the collection differently regardless of the content type individually (Please see below or read the README file in the module for more documentation).
  • The parent node object will be accessible to any child node object in the theme layer. Therefore you can add more logic onto it based on the relationship to achieve advance functionality.

This module is sponsored by:

  1. NBC Universal
  2. Tigase XMPP/Jabber Server

Documentation

Installing the module

  1. Login to your Drupal installation as an admin
  2. Go into Modules and enable Node Collection
  3. The module adds the following permissions
    • Administer Node Collections - Administer node collection so that you can create, edit or delete parent child relationships
    • Administer Node Contents - Add/Edit/Delete node contents for the relationships already defined

Add Relationship

  1. Login to your Drupal installation as an admin
  2. Go to Configuration => Content authoring => Define a Parent > Child relationship
  3. Add a relationship name, select the parent content type and the child content types and press "Save relationship" (Note: A content type can only be added once as the parent)

Edit or Delete relationship

  1. Login to your Drupal installation as an admin
  2. Go to Configuration => Content authoring => Edit or Delete relationship

Template overrides for node collections

Page / Page container :-
Common for all node collections : page--node_container_default.tpl.php
Parent type specific : page--node_container_[parent_node_type].tpl.php

Ex: If book is a parent of some relationship page-book.tpl.php can be overridden by adding page--node_container_book.tpl.php without effecting page-book.tpl.php

Node :-
Child nodes templates can be overridden per relationship as follows

Ex: node--[parent_nodetype]-[child_nodetype].tpl.php
In a parent-child relationship book is a parent node type and article is a child node type, article inside book can be overridden using the following template
node--book-article.tpl.php

Template variables available :-
page : parent_node_object
is_node_collection_container

node : is_node_collection
is_node_parent
node_collection_parent_node_id
parent_node_object

Live implementations/Examples

  1. http://www.universalchannel.co.uk/rookieblue
  2. http://www.syfy.de/serien/eureka-die-geheime-stadt
  3. http://www.syfy.de/games
  4. http://www.syfy.de/serien/stargate-universe

Will update the list as it goes... :)

Project information

Releases