Upgrade Your Drupal Skills

We trained 1,000+ Drupal Developers over the last decade.

See Advanced Courses NAH, I know Enough

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

Parent Feed: 

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!

Author: 
Original Post: 

About Drupal Sun

Drupal Sun is an Evolving Web project. It allows you to:

  • Do full-text search on all the articles in Drupal Planet (thanks to Apache Solr)
  • Facet based on tags, author, or feed
  • Flip through articles quickly (with j/k or arrow keys) to find what you're interested in
  • View the entire article text inline, or in the context of the site where it was created

See the blog post at Evolving Web

Evolving Web