This project is not covered by Drupal’s security advisory policy.

List of nodes as Views' filter

Views provides us with abundance of filters; however, Views doesn't provide a list of nodes as a filter for this reason. This module solves that issue by, well, using Views!

Views Node Filter obtains the result of a view's display to be used as a filter in another display (although you can still end up with the above issue if you create a view for a filter that returns thousands of results).

How to create a filter

Here's how to create a page where you can use an exposed node filter to filter the content (this is written with an assumption that the readers know how to use Views):

  1. Install and enable Views and Views Node Filter.
  2. First, create a view display that returns a list of node IDs. The result of this display will be used as a filter in another view / display.
  3. In 'Fields', add a 'nid' field (you can add other fields, but they will be ignored). Save the view.
  4. Create another view (or a display) for the actual page view. Create a page display and specify the path.
  5. In 'Filters', select 'Views Node Filter' and tick 'nid'. In the configuration box that opens below (if you have JavaScript enabled), select the view and display created in step #2.
  6. Expose the filter and click 'Update and override' or 'Update default display'.
  7. Save the view and open the URL to the page view.

Compatibility

  • 6.x-2.x branch is compatible with Views 6.x-2.x
  • 6.x-3.x branch is compatible with Views 6.x-3.x

To make it easy to see which version of Views Node Filter corresponds with which version of Views, this module will have no 1.x branch. In the 'Downloads' section below, it shows 6.x-2.x branch as 'recommended', but this is only because Views 6.x-3.x is in alpha (as of October 2011).

Known issues

  • When you select a view's display which returns the result for the filter, and that view is the very display you are editing, the page with the filter will return a WSOD.
  • The admin summary of the filter returns 'unknown' in 6|7.x-3.x branch, if the filter is not exposed.

Credits

Development of this module was sponsored by Comic Relief UK

Disclaimer

As always, use it at your own risk. If you encounter any issue, please report through the issue queue. The developer or the sponsor cannot be held accountable for any damage which the module may cause.

Project information

Releases