Experimental project

This is a sandbox project, which contains experimental code for developer use only.

This module allows you to add a shared "Filter" handler to multiple views which will include/exclude the IDs from the results of any view which shares the filter and appears on the same page. This is primarily used to randomize multiple views (such as in blocks or panels) on the same page without the risk of duplicated results between the views.

Notes:

  1. The filter excludes based on the primary key of the views table for each view, and thus is only useful when combining Views that operate on the same base table.
  2. Make sure to add a Sort: Random sort handler to each View to get the desired effect. (Or don't, if you know what you are doing.)
  3. The handler accepts either "Is one of" or "Is not one of" options. "Is one of" will synchronize the results of all Views which share a key, while "Is not one of" will exclude all prior results.
  4. The filter accepts an input for a "shared key" which defaults to the view's base table. This can be changed if you only wish to use it on a subset of views on a given page.
  5. There is no ability to change the field (always the primary key of the base table) which is filtered. This is particularly consequential for views which summon other base tables via relationships -- there is currently no functionality for this use case.
  6. Since all this filter handler does is assemble a sequence of IDs to exclude, performance with very large datasets is not likely to be extraordinary. Hopefully use cases for this need and very large datasets are rare anyway, but please be advised.

Project information

  • Created by Kazanir on , updated