How to remove exposed filter if value is supplied in url? We have a view page (path = /some-path/) that has an exposed filter called category. The detailed view setup is below. How would we hide the exposed filter if it is supplied from the url?

View setup:

Filter criteria:



Settings:


Operator = is one of (list of all tags term values)
Filter type to expose = single filter


Advanced




Require relationships for field_tags
when the filter value is not in the url --> display all results for the specified field
when the filter value is in the url or default is provided 

a. specify validation criteria -&gt; validator -&gt; taxonomy term name where vocabulary = tag

b. action to take if filter value does not validate = display contents of no results found

c. case = lower case

d. more -&gt; transform spaces to dashes in url -&gt; enabled


Expected behavior:


when /some-path/ is navigated to, then the exposed filter should show
when /some-path/term-value/ is navigated to, it will filter the results and hide the exposed filter


Current behavior:


navigating to /some-path, shows all results with the exposed filter displaying allowing a visitor to change it.
navigating to /some-path/value2/ filters the results and displays the exposed filter.
Here's a clever way to do it without coding: use two different Views displays and embed one of them as View area into another's No results behavior and configure the contextual accordingly. 


Create the Page with the Exposed Filter but without the Contextual filter
Duplicate that Page to create another Page display with the same Path, but make these changes:  


override the Filters and remove the Exposed filter 
override the Contextual filters and Add your Term name there with these settings:
When the filter value is NOT available
Display contents of "No results found"
When the filter value IS available or a default is provided
Specify validation criteria
[your settings]
Action to take if filter value does not validate
Display contents of "No results found" 
Override the No results behavior, add View area and choose the first Page display under View to insert (the one with the Exposed filter). Save the View if you don't see that display as option at first. 



This way you get the first page to kick in for /some-path and you see the exposed filter, but if you add a term name to the path and it validates /some-path/value2/ the second Page display kicks in and you don't see the Exposed filter, you see the contextual results. 

If the argument doesn't validate, you see the first Page and allow users to choose the term from the Exposed filter. You can change that to something else if it makes more sense. The part that makes this views switching work is the first part of the contextual filter When the filter value is NOT available
Display contents of "No results found" and the embedded View area.