Node reference views

Last modified: June 10, 2009 - 08:53

The Node reference views module is a formatter for the CCK nodereference field. It uses a view that you've created to display the field, so instead of the default list of node titles, you can have anything Views can show you from those nodes.

Example

Suppose you have project nodes, and you put a CCK nodereference field on project nodes to pick the best forum posts about those projects. Default CCK nodereference will display your field as a list of titles, or a list of teasers, or full nodes.

Node reference views allows you to use a view for this display. You could, for example, create a table view that shows forum post title, author, number of comments, and last updated time. This view would then appear in your project node as the display of the CCK field.

Usage

Install the module as usual.

Go to the views admin and create your view. The view should have the same name as the field, including the automatic 'field_' prefix, eg 'field_my_noderef'.

To get started, you can clone the example view that comes with this module: it comes with the argument already set. You can add any fields and sorts and filters. One limitation however is that the order of items set in the CCK field isn't accessible to Views.

Go to the display settings for your field, and pick 'View' as the display option for your field.

Troubleshooting

Before filing a support request, please check the following:

- Clear your cache if the view option doesn't appear in the CCK display options.
- This module is a formatter. It doesn't do anything to the widget on the node edit form, or affect it in any way.
- This module doesn't let you pick a view for each node. It uses one view for your field, on every node. Look at modules such as Viewfield, View Reference for this.
- The view is selected automatically by its name. The 'advanced view' section in the field settings uses a view to make the list of nodes you pick in the widget, which is a different thing entirely.

 
 

Drupal is a registered trademark of Dries Buytaert.