mediatribe.net -- Drupal and Web Development

Views

Displaying a block with a field from the current node using Views 2 and Drupal 6

I have a CCK field with an image on my page nodes. I want to display a block with the CCK field value on its related node, but nothing on non-pages.

This often works in the views preview, but not on the actual page. This was driving me nuts and I spent a few hours finding this solution:

Create view with

  • Filter: node nid > 0
  • Argument: node nid, Action to take if argument is not present: Provide default argument: node nid from URL; validator: basic. Action to take if does not validate: Hide view
  • Create a new block display and you're done!