Vasyl Yaremchuk

How to exclude the current node from a list view in Drupal 7

This is the instructions corresponds Drupal 7 + views 3.

There is a standard problem, we have the teaser of a random node in the block,
but it would be wrong to deduce the node teaser page on the page of it's full view.
Lets do following in views settings:

  1. Click on the "advanced" fieldset.
  2. Click on add under "contextual filters". We are going to add new contextual filter.
  3. Choose Content:nid.
  4. Under "when the filter variable is not available", choose "provide default value".
  5. From the drop down menu select "content id from url".
  6. Scroll all the way down to the bottom of the window and click on the "More" link.
  7. Click "Exclude".
  8. And be happy!