Interaction to add a search parameter to the current URL

Is there a way to use interactions to append text to the current URL?

I have a query loop on a page that can be filtered using WP Grid Builder. When you apply filters, it appends the URL to include the search parameters like this:
/groups/
/groups/?_group_category=community-group

Is it possible to use an interaction to add that filter without reloading the page? I’ve found several methods to go to the URL with the search parameter applied, but they all reload the page. My goal is to have a button higher on the page above the query loop that, on click, scrolls to the query loop and applies a filter.

Hi

Is there a reason why you are not using simply a button facet from WPGridbuilder?

Cheers

Patric

Yes. From what I can tell, I can only use WP Grid Builder to build groups of buttons, and in the use case that I’m trying to implement, I need a single button to show a category, not a group of buttons to change categories.

Ok, now I understand the dilemma.

Let me see if I have an idea…

1 Like

I was able to find a method that could append the URL without reloading the page, but it doesn’t apply the filter unless the page reloads, so I may need to do something with Grid Builder to get the filter to apply.

Yes, I will look into WPGridbuilder…

Hi

I came up with this solution.

Create a new Button facet and use the “Exclude Terms” field to exclude all but the desired category.

Here is my example:

Facet output:

Filter1

You can see in the screen shot above that the new Button facet only has one button because I excluded all the other categories from that Button facet.

Below the single button you see the normal Button facet that has all the available categories.

Does this solution work in your case?

Cheers

Patric