Node reference and Views 2: How to define a "refers to nothing" filter

This was a problem I had some time ago, and I'm pretty sure this post will save time to some people.

The problem: Using a Node reference field and Views 2, how do I define a "refers to nothing" condition in the filters?

Solution by merlinofchaos: Add the node reference as a relationship. Then add the Node: Nid filter, set it to the relationship, and set the operator to Is Empty.

This method, changing the operator, can be used for the opposite: refers to any node.

It sounded so easy when merlinofchaos explained it to me...

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <i> <b> <strong> <cite> <pre> <code> <ul> <ol> <li> <dl> <dt> <dd> <p> <img> <h2> <h3> <blockquote>
  • Lines and paragraphs break automatically.

More information about formatting options