Skip to main content

Post categories

  • Drupal Tips & Tricks
  • Drupal Howtos
  • Drupal Themes
  • X Twitter
  • youtube
Home
Drupal 4U
Drupal Development, Drupal Web Design, Drupal SEO
  • Home
  • Showcases
  • Services
  • Blog
  • Themes
  • About
  • Contact

Breadcrumb

  1. Home
  2. Tips and Tricks
  3. Drupal Views: Exclude current node from a list view

Drupal Views: Exclude current node from a list view

Tips and Tricks
May 29, 2017
Profile picture for user drupal
By drupal
  • facebook-f
  • twitter
  • envelope
  • print
553

In some situations, for example a block listing nodes related to the node being viewed, you might wish to exclude the current node from a list view.

Views 3

  1. Click on the "advanced" tab.
  2. Click on add under "contextual filters".
  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"

Views 2

Use views arguments, assuming this is a block view

  1. Add an argument for Node: nid
  2. Set 'Action to take if argument is not present' to 'Provide default argument'
  3. Set 'Default argument type' to 'Node ID from URL'
  4. Check 'Exclude the argument'

See: https://www.drupal.org/node/131547

Drupal Views: Exclude current node from a list view

Read more articles

Newer
Trobleshooting computed field with Drupal 8 (Drupal core 8.3.2; May 2017)
Older
Drupal 8 SEO Book: Now anyone can optimse a Drupal 8 website easily!
  • Log in to post comments
Profile picture for user drupal
drupal
553
1
min read
A- A+
  • facebook-f
  • twitter
  • envelope
  • print

Contact Drupal 4U

Get in touch for questions and our Drupal development, design and SEO services.

Contact Us

We aim to reply the latest within 48h.

About Drupal 4U

We are a group of Drupal designers, developers and webmasters and we launched this website to share our experience and knowledge with you. Drupal is a free software package that allows you to easily organize, manage and publish your content, with an endless variety of customization. Drupal is open source software maintained and developed by a very large community of developers and users.

  • X Twitter
  • youtube

Drupal Services

  • Drupal Web Design
  • Drupal Development
  • Drupal SEO
  • Drupal Migration

Drupal 4U

  • Services
  • Showcases
  • Themes
  • Blog
  • About

Drupal Links

  • Official Drupal Website
  • Drupal Answers
  • More Than Themes
  • Theme Forest
  • DXPR: Drupal for Marketers
2012 - 2025, Drupal 4U

Footer menu

  • Contact
Home
Drupal 4U
Drupal Development, Drupal Web Design, Drupal SEO
  • Home
  • Showcases
  • Services
  • Blog
  • Themes
  • About
  • Contact
Clear keys input element