I sometimes use contextual filters to display fields matching the content ID from url

In that case , i would like to display a list of content as a view block , except the one that is displayed

It would require to :

  • negate the condition " Content ID from URL contextual filters "


  • being able to choose the 'content id from url' as value of a view filter

I don't know how to do the first option. That token conditions module would do for the second option but is not stable https://www.drupal.org/project/token_conditions

How can i possibly do that then except JS?

1 Answer 1


Considering the first option, it is simple :

add a contextual filter of type "ID: Content" with the following configuration :

  • WHEN THE FILTER VALUE IS NOT AVAILABLE > provide a default value > content id from url
  • Go all the way down in the "more" section, expand it and check "exclude".
  • Then click apply
  • And save the views

That's it !

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.