David Lohmeyer's Blog

Using a nid argument in a block view in Drupal 6

I had a bit of an issue with this since I'm used to using arguments on view pages.  To use node id as an argument with a block view you cannot simple use the "Hide view / Page not found (404)" under "Action to take if argument is not present".  Instead, do the following:

  • Select "Provide default argument" under "Action to take if argument is not present"
  • Select "Node ID from URL"
  • Save your view and include your block on the targetted pages

This way you'll be able to pass the nid argument in your URL to the block view.  Whew!

Related Posts