Sorted by a RG with a button

Hello everyone,

I have a RG with the items I sell on my website. The RG is filtered like this :

And my user click on filters like this :

In addition of these filters, I would like to let the user sort the items by the “newest”, and the “price” when they click on a button. So I try to use a workflow with custom state and when they click on “sort by the newest”, I display data in the RG sorted by creation date.
Capture d’écran 2020-12-22 à 10.54.59

However, when I do that, my other filters (on the picture above) doesn’t work. The “bad” solution would be to duplicate my condition in every workflow so that filters would work.

But is there any simple solution to sorted by a data that is already filtered like my RG ?

Many thanks!
Thomas

I’m fairly new to Bubble.io but I’ve just tried to recreate what you’ve done and I have all the filters working with the sort by newest / price / colour etc by adding a condition to the RG "when [your sort] input is chosen, do a search for items:sorted by [whatever you want]. Just copy the data source from your RG that include your filters and paste it into that above ^. Do it for every sort you’d like.

If I’ve misunderstood I apologise!

Hi @tzuork, thanks for your answer!

Actually I’m looking for solution that doesn’t need to copy/paste the data source with all my filters. Because I already have a condition for mob :
Capture d’écran 2020-12-22 à 14.04.16

So it would be a lot of condition. But if there is no other solution, yours is good one :+1:

Thanks,
Thomas

Hi Thomas,

May I ask why you’re searching a database to filter results depending on your page size? Surely no matter what size the page is you’d want the same results being shown?

Ash

It’s not the same filters when the current page width <768. So I need to put a new “Do a search for:filtered” to link to the “mob” filters.

What filters would you not want a mobile version to have that you want a PC version to have? Trying to understand why you’ve set it up the way you have so I can give you the best way of doing it.

Desktop version :

Mobile version (floating group) :


Thanks for your help :wink:

I’m with you - would it not have been easier to do it the way Bubble intended and use the mobile version aspect in the page settings so when a user goes on that page it automatically shows your mobile version?

Referring to Bubble documentation this way would be better performance wise.

Screenshot 2020-12-22 135124

Yes but with this solution you create 2 pages for 1 content, not perfect for the SEO. So we decided to make every page full responsive (more or less).

And most of my pages are responsive without condition, except for the filters in fact

This topic was automatically closed after 70 days. New replies are no longer allowed.