Skip to main content
  • X Twitter
  • youtube
Home
Drupal 4U
Built for AI. Powered by Drupal.
  • 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
592

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
592
1
min read
A- A+
  • facebook-f
  • twitter
  • envelope
  • print

Contact Us

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

Contact Us

We aim to reply the latest within 48h.

Drupal 4U: Built for AI. Powered by Drupal.

We are a group of Drupal designers, developers and webmasters. We are Drupal experts! We provide comprehensive services that go beyond traditional web development, focusing on how AI understands, interprets, and cites your content. With our deep expertise in Drupal's architecture, we build the intelligent core of your digital presence, ensuring your brand remains authoritative and visible in a world where AI is the primary gatekeeper of information. Partner with us and let's future-proof your digital strategy together.

  • X Twitter
  • youtube

Drupal Services

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

Drupal 4U

  • Services
  • Showcases
  • Themes
  • Blog
  • About

Drupal Links

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

Footer menu

  • Contact
Home
Drupal 4U
Built for AI. Powered by Drupal.
  • Home
  • Showcases
  • Services
  • Blog
  • Themes
  • About
  • Contact
Clear keys input element