Recipe: Filter by multiple nids
Use case: Filter by multiple nids and need EVI e.g. because you need "or".
You are browsing documentation for an older version of Drupal, which is not supported any longer, and the information may not be correct. See current documentation for Contributed modules
This is the documentation for the Views EVI (Exposed Value Injector) module.
We will start with a canonical example for site-builders.
What is the problem that this module wants to solve?
There are things we can do with exposed filters that we can't do with contextual filters, like:
* Use "or" with them
* Use "<" or ">"
## TODO: Refactor the rest of the page to match the above. ##
(The use case below is valid, but not the biggest pain spot.)
Sometimes, there is a conflict between the contextual filter (supplied via the URL) and the exposed filter (supplied by a form in a view).
This screenshot shows a view of 10 nodes:
- contextual filter is set to "Content: Nid"
- exposed filter is set to "Content: Nid"
In the screenshot, no results are displayed, because of a conflict between the contextual filter (6) and the exposed filter (3)

A common thing that we would like to achieve is the following:
If no contextual filter is supplied on the url:
- we get all nodes displayed
- the exposed filter is displayed
If we have a contextual filter supplied on the url:
- the value of the exposed filter is set to the contextual filter value
- the exposed filter is hidden
Let's see how we can do this with the Views EVI module.
Install and enable the Views EVI module.
[At least in D8]: Enable "Views EVI" under "Display Extenders" in the Advanced Views Settings (/admin/structure/views/settings/advanced), you can get there fast by following the Configure link next to the module entry in the Modules list.
Important. Replace the Contextual Filter in your view with the "Global: Null" filter, so that the only Contextual Filter you have is "Global: Null".
What does "Global: Null" mean? Well, it's a contextual filter which (by itself) does nothing. We will use the Views EVI module so that its value gets injected into the exposed filter.

Under "Filter Criteria", add a new filter. Select the field you want to match with the contextual filter and check the option "Expose this filter...".
In the views UI, under Advanced > Other, you will find the following options:
- Views EVI: Plugins
- Views EVI: Settings
For "Views EVI: Plugins", apply the following options to the "Nid" exposed filter:
Value: Value with tokens
Visibility: Visible if no value

For "Views EVI: Settings", apply the following options to the "Nid" exposed filter:
Filter value: !1
Visibility inhibiting value: !1

Save the view.
Now, when we have no contextual filter on the URL, the exposed form is available.

However, if there is a contextual filter on the URL, then the exposed form is hidden.

Use case: Filter by multiple nids and need EVI e.g. because you need "or".