Views attach

Crell - January 13, 2009 - 08:07

This module provides two additional Views display plugins, "Profile" and "Node content". These displays do not display on a page but get "attached" to either a user page or nodes of specified types. These views are not stored with the user or node, the way viewreference.module would, so they can be globally-reconfigured.

The node content display can be reordered on the "Manage fields" tab if CCK is enabled. If not, it will have a weight of 10 so it floats to the bottom of the node.

Usage tips

Many people have asked how to use this module to show content related to the node or user to which a view is attached. The answer is to use Arguments. Even though attached views have no path, they still get to make use of arguments.

  1. Create a nodereference field on some node type. Create several nodes of that type that nodereference to some other node.
  2. Create a new "Node content" display. Configure it as desired.
  3. Add an argument for the nodereference field you created in step 1.
  4. Set the default value of that argument to "Node ID from URL".
  5. Set the display to show on node types that are pointed to by that nodereference field.
  6. Profit! The view will now show all nodes that nodereference TO the node currently displaying (plus whatever other filters you have).

The same approach works for nid, uid, userreference, or similar fields. There's much fun to be had with Arguments. :-)

Credits

Views_attach was originally developed by Jeff Eaton but never released. Larry Garfield later cleaned it up and added the CCK integration.

Releases

Official releasesDateSizeLinksStatus
6.x-2.22009-Oct-0811.96 KBRecommended for 6.xThis is currently the recommended release for 6.x.
6.x-1.22009-Apr-299.97 KBSupported for 6.xThis release is supported but is not currently the recommended release for 6.x.
Development snapshotsDateSizeLinksStatus
6.x-2.x-dev2009-Nov-1914.68 KBDevelopment snapshotDevelopment snapshots are automatically regenerated and their contents can frequently change, so they are not recommended for production use.
6.x-1.x-dev2009-Nov-1911.72 KBDevelopment snapshotDevelopment snapshots are automatically regenerated and their contents can frequently change, so they are not recommended for production use.


 
 

Drupal is a registered trademark of Dries Buytaert.