I am wondering how can I use a dropdown list in my home page, and have a button that leads to a page with my collection already filtered by the dropdown value ?
Think about a restaurant chains. I have my Homepage, and a page called Restaurants, where you can find a list in a repeater with all the locations.
I would like to have a dropdown list on my homepage, that let the user choose a city, and when he clicks on a button, it loads the Restaurants page with the repeater already filtered.
For now, I have my dropdown list on my Restaurants page, and it works fine for filtering the repeater where clients are already on the page.
A way to filter it from the prvious page would be awesome.
You could use URL parameters to pass value to the new page and then use wix locations’s query function to retrieve the value of the parameter and filter the dataset on the destination page.
Hum… I must have felt a bit overpowered when I wrote my last message. Sounded clear but I can’t figure it out.
What you tell me do to is :
Use the user input to add an URL parameter to my next page’s URL.
And then, use a function to retrieve this parameter and use it to filter the DB ?
Is that right, or am I missing something.
If it is ok until here, now I am stuck. Because I don’t really know how to code an URL modification depending on user input choice, and I also can’t figure out how to use the function you are talking about.
Maybe some kind of example could help me.
The page where the user input is :
www.mysite.com/home
User can choose between London and Paris and that would lead them a dynamic page :
www.mysite.com/restaurant?parameter=London
What is the code that I need to add, and on which page ? Because I supposed I will have two different code on the two pages.