Hi,

Is it possible to remove arguments that are passed in via the URL string when applying filters via an exposed filter?

E.g. I have a view set up called "link" that takes a taxonomy term as it's argument e.g. "link/apples".

Now I want the ability to jump to another taxonomy term using an exposed filter, but if I try this, then the url becomes "link/apples?tid=47" which simply gives me no results because it is first filtering on the apples taxonomy term, then on the "47" term which is say "pears".

If the "apples" term name was removed from the URL then I would be able to jump to the correct taxonomy term. Is it not possible to use arguments and exposed filters alongside each other?

Comments

merlinofchaos’s picture

Status: Active » Closed (won't fix)

This is not possible.

tordrup’s picture

Actually, it is possible with one line of javascript, if you don't mind approaching it that way.

Put this in the footer of the view, or in your template. Make sure you test for the existence of the form in DOM first.

		<script type="text/javascript">
		document.getElementById('views-exposed-form-VIEWNAME-default').action = "/VIEWPATH"; 
		</script>

Obviously useless to users who don't run javascript, but what the hell.

D

gotcha41’s picture

I'm looking for the same functionality, trying to remove arguments when applying an exposed filter.

EDIT
THANK YOU tordrup!! Your solution worked like a charm.
Before, I had to hardcode the exposed filter form to get rid of the arguments. Now, on the other hand, I can fully use the existing functionality of exposed filters

Thanks for sharing this solution ! great !

Scenario:
--> filter a view by an exposed filter --> use glossary to filter THESE results again by letter "a" (uses arguments) --> apply new exposed filter that ignores the glossary argument filter