Score:0

How to keep Contextual Filters (query) on Exposed Filter change

nl flag

I have a view page that leverages Contextual Filters with query parameters. So when a user visits the view page, the URL is as such… /search?location=san+francisco. This works as expected.

Now there are 3 exposed filters for this same view. When the user selects an exposed filter, the above contextual query parameters are replaced with the exposed filter parameters, as such /search?weather=cloudy so the view output is incorrect.

Ideally, I want the URL to be /search?location=san+francisco&weather=cloudy.

How do I go about keeping the Contextual Filter query parameters on the Exposed Filter change? In other words, combining the two instead of the Exposed query replacing the Contextual query.

Score:0
nl flag

Found patches for both core and better exposed filters module that preserves the query parameter when exposed filter is initiated.

https://www.drupal.org/project/drupal/issues/2681953 https://www.drupal.org/project/better_exposed_filters/issues/3119947#comment-14289676

Apply the core patch first if using bef.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.