Other View Filter

Categories

Component ID

2733827

Component name

Other View Filter

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Component created

Component changed

Component body

Frequently two views, or two displays of one view, occur on the page together. One common example is a listing of content with a few curated items selected via more specific criteria. It's simple enough to create two displays and show the curated one above the general listing. This presents a problem: content that appears in the curated list needs to somehow be excluded from the general listing.

The filter provided by this module can be used to exclude a node or multiple nodes from a view, by excluding the results of one view from another one. This allows you to filter a view by another view.

A couple of other projects have taken a stab at solving this problem:

  • Views Exclude Previous
  • - attempts to determine what content has already been loaded on thep age, whether by views or by some other method, and exclude that from the current view

  • Views Pipes (sandbox)
  • - does some fancy stuff with contextual filters and configuration settings

  • Views Field View
  • - similar concept to this, but using a field handler rather than filter handler, allowing you to embed a view as a field in a view.

  • Views Filter View - very similar.

This module takes a simple Views filter approach. Using it is easy:

  1. In the view from which you wish to exclude selected items, add filter "Content: Other view result"
  2. Select the view/display combo whose output you want to exclude from the current view.
  3. Save the view.

To minimize the cost to performance of running multiple views queries, the number of instances of this filter on the same display should be kept to a minimum and caching should be employed liberally. Views Content cache and Cache Actions are helpful for this.

This has only been tested on nodes, managed files, and users. It isn't yet compatible with other entity types.