Node Reference Variables

Drupal Modules - Wed, 01/07/2009 - 9:45pm

This module exposes CCK Node Reference fields in a variety of ways using the Drupal 6.x hook_preprocess_node() hook to populate variables that are then available to themers in node.tpl.php. Inline documentation:

<?php
/**
* Implementation of hook_preprocess_node().
*
* Adds the fully loaded node object for each referenced Node
* Reference node attached to the parent node, E.g. if you
* have a Node Reference field called field_foo and it has
* three values, the loaded nodes will be accessible using:
*
* print_r($field_foo[0]['node']);
* print_r($field_foo[1]['node']);
* print_r($field_foo[2]['node']);
*
* Also adds the rendered mark-up for the node, if requested:
*
* print_r($field_foo[0]['node_rendered']);
* print_r($field_foo[1]['node_rendered']);
* print_r($field_foo[2]['node_rendered']);
*
* Finally, adds jQuery tabs for each Node Reference field
* value, rendered and ready to use in this variable:
*
* $nodereference_tabs
*
* Note, all options can be disabled at:
* admin/content/nodereference_variables
*/
?>

This project is being developed by Greg Harvey: http://www.drupaler.co.uk
And sponsored by CMS Professionals: http://www.cmspros.co.uk