WIP: URL parameters for filters

Will there be an option to work with filters without ajax?

It would be nice to make a separate option, when enabled, parameters from the selected filters will be dynamically added to the shared URL.

It is also better to make these parameters configurable so that in the URL, instead of technical information about the request, you can see simple and understandable SEO parameters. This will make it easier to read information from the URL, as well as have a permanent link to the filtered page.

For SEO, of course, you will need more settings there, but you can start by adding parameters to the URL.

28 Likes

I wholeheartedly endorse this!!

That’s a must have, I agree

Yes please, we need this!

Agreed. A toggle for this functionality would be ideal. Without it, you can’t really do anything too advanced with the new filters, but with it you could do all sorts!

Another thing as an offshoot, would be to enable filters not connected to a query - but that instead simply pass their values to a url via query string, and pre filter the target page with their values

5 Likes

Upvote for this !
Optional and configurable search parameters would be needed.

1 Like

It is important that also supports browser’s window.history.go(-1); , so when an user goes back to previous page, the grid stands at the same position.

I mean, a customer filtering and browsing a product archive on page XX / sort by YY, then he visits a product and goes back, sadly the product grid resets, because the browser was not managing the filters and pages with an url. Same with Ajax.

4 Likes

In modern browsers and HTML5, there is a method called “pushState” on window history, and also “location” to alter the URL after applying, i.e, filters, or opening a modal or pop up. Wisely combined they will push changes from filters/sort to the browser’s URL and also pushing the URLs to the history without loading the page.

This additionally allows the visitor to create and share URL bookmarks that include filters and sorting parameters.

This can go further on sliders and modal pages presenting contents in sliders.
Instagram website is a good example, it always uses URL location/ pushstate method presenting posts on a slider which is contained on a modal box which lays over a grid layout. Despite this 4 level hyerarchical layout, each post can be easily bookmarked/shared by visitors, browser history and crawlers, and be navigated seamless on mobile displays without reloading the page.

The attribute location.reload(true) will optionally reload the page.

I hope this is supported soon by Bricks

5 Likes

I agree this is a must have.

But I am wondering, do the Bricks developers actually know what’s being asked here? Perhaps they don’t monitor the forum and need to be alerted? What’s the best way to do so?

1 Like

If you want them to even consider a feature then you need to create a new idea for it. Then they may or may not accept it. If they do then people can vote for that idea.

I already submited the idea weeks ago, but it never got published on https://bricksbuilder.io/ideas/

Yes, URL parameters are essential. I understand the filters are still “experimental”, but I was surprised that they didn’t use URL parameters, like e.g. the popular filter plugins.

2 Likes

Any updates on this or any responses?

Hi @Spipov ,

We are working on it.

Regards,
Jenn

5 Likes

I fully need this!
We need to create advanced filters such as searching for tours or hotels websites.

I would also like to add my 2 cents here, as I am currently grappling with this.

In addition to the parameter specification in the URLs, it would also be advantageous to enable automatic conversion to directories. Large eCommerce stores sometimes do this.

The problem with parameters is that they are not very suitable for SEO. You can only add meta data in a roundabout way and the pages are difficult to edit.

Example:

domain.com/shop/category/presents/birthday/

You could now create two categories here: “Women” and “Men”. Using filters, it would be possible to search for birthday presents for women and men.

The problem:
Most filter plugin add parameters.

e.g. domain.com/shop/category/presents/birthday?gender=male or domain.com/shop/category/presents/birthday?gender=female

“Birthday presents for men” has a very high search volume and we actually have the perfect page for it, but the meta data of the parameter URLs is complicated to edit.

It would therefore be great if the parameter URL could be converted automatically.
From: domain.com/shop/category/presents/birthday?gender=male
To. domain.com/shop/category/presents/birthday/male/

Since the category has been created, you can then maintain the meta data via the “Male” category.

You can see what happens in the following two stores when you set the filters:

It would probably only be interesting as an “optional” option, as in some cases the parameter variant makes more sense.

2 Likes

I fully support your idea!

Such a tool is certainly needed, but it is unlikely that the developers will make it, since it goes beyond the functionality for filters to work.

In fact, there is already a similar tool :slightly_smiling_face: It works well with regular themes. I haven’t tested it with Bricks.