Example of the ERD provided by the Node Relationships module

The Node Relationships module provides methods to complete two way relationships between content types enhancing the features of node reference fields.

Almost all the settings to administer the features of this module can be located at Administer -> Content management -> Content types -> [type] -> Relationships.

Features:

The Node Relationships module provides the following features:

  • Node reference extras:

    This module provides several enhancements for node reference fields configured to use the autocomplete widget:

    • View reference in new window
    • Edit reference (in modal frame, updates widget if node title changes)
    • Search and reference (single and multiple value selection)
    • Create and reference
    • Translate and reference

    When these options are enabled, a new button for each one will be rendered in the node edit form, next to the corresponding autocomplete widget of the node reference field. These buttons will open a popup dialog where each feature is available.

    For nodereference fields defined with multiple values, a new button will be available next to the "Add more items" button that can be used to search and reference several nodes at a time.

    The "Search and reference" feature uses a view that is dynamically configured so that a single view can be reused by several node reference fields. A default view is provided with basic fields and pages for table or grid styles. You can modify and/or clone (recommended) this default view to add more field, filters, etc. A filter per node type is dynamically created to match the "Content types that can be referenced" option in the global settings section of the node reference field. Note that you should configure this option explicitly even if you use a view for the node reference field.

    The "Translate and reference" feature is available when the Drupal core translation module is enabled, and additional support is provided when the Internationalization module is enabled. It is recommended to enable the "Switch interface for translating" option in the Multilingual system settings page for the "Translate and reference" feature to work properly. When the "Translate and reference" option is enabled for a particular node reference field, references that already have translations will be automatically assigned to the values of node reference fields when a node translation is started. For those that do not have translations, a message will be displayed on the create translation form to warn the user a translation is missing and an option to translate and reference will be provided.

  • Automatic back references:

    This module provides a method to display back reference views on referred nodes. Back reference definitions are taken from the "Content types that can be referenced" option in the global settings section of node reference fields. Note that you should configure this option explicitly even if you use a view for the node reference field.

    These back references do not need additional data stored in the database. Instead, views with the proper relationships are used to join the node reference field data with the corresponding nodes in the database. These views can then be used from the referred content types to provide a list of referrer nodes. The Node Relationships module provides a default view that you can modify and/or clone (recommended) should you need to add more fields, filters or change any other option to suit your needs.

    Each back reference can be displayed using one of several methods to render the corresponding view in the referred node itself (Field, Page and Tab).

    • Field: When a back reference is configured as a "Field", the Node Relationships module creates a CCK field automatically that provides the view output, and you can drag'n'drop this view to any position from the "Manage fields" panel of the content type. Note that no input widget is provided for this kind of fields, only the view output is provided.

      Field formatters available:
      - Back references view: renders the customized view as usual.
      - Back references count: displays the count of back references (taking node revisions into account).

    • Page: This method provides a fieldset where all back reference fields assigned to this region will be rendered. This fieldset can be dragged to any position in the node using the "Manage fields" panel of the content type.
    • Tab: This method provides an alternative to the "Page" region, but the back references are displayed on a new tab "Relationships" added to the nodes where this option is enabled.

    A note on performance of back reference views: latest development snapshots of CCK include a feature that allows fields index their columns. This is implemented for node and user reference fields that automatically create an index by the reference value column (see: #231453: Allow indexing columns). This means back reference views can take advantage of this index to resolve the join with the field table used by the automatically customized relationship on these views. Still, it is recommended to perform an EXPLAIN on the queries executed by views as peformance may depend on a few more factors. You may also wish to take advantage of the new Cache options implemented in Views since 2.6 (see: #468824: Add caching system to Views).

  • Entity relations diagram:

    This is a basic diagram of the relations of current content type with others (referred from and refers to). It can be used to walk the relationships of all types in the system. This diagram is available per content type from Administer -> Content management -> Content types -> [type] -> Relationships.

Requirements:

Recommended:

  • Reverse Node Reference: Enhances Views with reverse relationships for Node Reference fields.
  • Content Type Selector: When you are on the "Relationships" tab of the content type administration pages, it helps navigate from one type to another easily.
  • You may also want to check out the modalframe_cck_manage_fields, part of the Modal Frame Contrib Package. It opens CCK field and group settings forms in modal frames.
  • Referential Integrity for CCK: allows you to decide what to do with reference values when a referenced entity (node or user) is deleted.
  • Panels: If you use Panels, then you may want to check out the CCK integration features, where you can plug any field in your node view based panels, and that means you can place your Back reference views at any position in your panels, as a block, and so on.
  • Checkall: provides "Check all / Uncheck all" feature to module administration pages.
  • Views Fluid Grid: provides a new Views style plugin that implements a fluid grid layout that is pretty nice for image galleries.

Advanced usage:

How can you get involved?

This module has been sponsored by Gamefilia.

Project Information

Downloads