Redirect a page to a dynamic page

How do i redirect a page to a dynamic page having two drop down and one search button?

from this page having two drop downs and a search button

import { local } from ‘wix-storage’ ;
import wixLocation from ‘wix-location’ ;

$w . onReady ( function () {});

export function searchButton2_click ( event ) {
I don’t know what to put here :sob::sob:
[wixLocation](wixLocation.to(‘/properties3’);
}) [.](wixLocation.to(‘/properties3’);
}) [to](wixLocation.to(‘/properties3’);
}) [(](wixLocation.to(‘/properties3’);
}) [‘/properties3’](wixLocation.to(‘/properties3’);
}) [);](wixLocation.to(‘/properties3’);
})
[}](wixLocation.to(‘/properties3’);
})

The Location is properties3

To this dynamic page

import wixData from ‘wix-data’ ;

export function searchButton_click_1 ( event ) {
search ();
}

function search () {

wixData . query ( "Properties3" ) 

. contains ( “area” , String ( $w ( “#dropdown3” ). value ))
. and ( wixData . query ( “Properties3” ). contains ( “details” , String ( $w ( “#dropdown4” ). value )))

. find ()
. then ( results => {
$w ( “#propertiesRepeater” ). data = results . items ;
});

}

Can Anyone Help Me Please!!!

I think it would be better to show your setup in your DB, related to the dynamic page and a screenshot of your dynamic page itself. It would make things to be a little bit easier.

I have got the code from this page
https://codequeen.wixsite.com/search-redirect

It works with a search bar, can you modify it for a drop down filter :slightly_smiling_face:

If i understand you the right way. you want to jump from page-A to page-B [copy&paste the valued Dropdown-data from page-A (non-dynamic-page) to page-B(dynamic-page)] ?

On page-B you then want to put the data into your search-engine to get some results out of your Properties3 database?

And i assume that you will delete all 3-buttons on your page-B later, right?

Either it does not make any sence to have 2x the same setup on 2-sites.
You have to choose on page-A and then to choose again on page-B ?

@russian-dima

It might be easier for visitosr who can search directly from the home page, which redirects them to the results.

For example, visit this site
(charteronerealty)
Look at the home page, how easily can people search for properties from home page

@andresbrahma08

Ok, like i already expected.

I will explain what you want.

Your aim should be to place a SEARCH into your HEADER. Why into the HEADER ? —> Because you can FIX your HEADER. It will always stay on TOP of your SITE.

But your results will be on your DYNAMIC-PAGE and your dynamic-page will be scrollable . In this case you will have the advantage to have a NOT -SCROLLABLE-HEADER . And a second advantage would be —> you do NOT have to switch between pages anymore.

You have your SEARCH on the top of your page and you will get shown your results directly under the HEADER-Section .

This should be your aim!

How to achieve such an functionality?

Add a STRIP into your HEADER . Be sure that the strip is surely added to the HEADER-SECTION . How to be sure? When the strip is attached to the header, it will become —> ORANGE !

After you have added a strip to your header, you can add a —> MULTISTATE-BOX , into the new HEADER-STRIP .

Why you add a STRIP to the header? Strips are RESPONSIVE and can be hidden and shown if not needed. You can add several STRIPS into Header, but if you have a MULTI-STATE-BOX in your header, than you normaly need just 1-STRIP.

Why adding a MULTI-STATE-BOX to your header?
Because you will get the ability to switch between different STATES inside the MSB. You surely want to add more to your header than just the seachr-bar. :wink:

OK! After you have done your new SETUP, what next?

Now comes the coding!
As i already said before, you will need to get the INPUT-VALUES in your HEADER and transfer them to your DYNAMIC-PAGE, where you will do the FILTERING-PROCESS.

For this you will need —> Wix-Storage!
Choose one of the given options here… (session / local…and so on)
https://www.wix.com/velo/reference/wix-storage

After you have selected some items inside your dropdowns you save selected values into Wix-Storage.

OK! Values saved into Wix-Storage, what next?

You will also need a REDIRECTION to your DYNAMIC-PAGE (ALL), after clicking onto the SEARCH-button.

Use → Wix-Location for this… ( wixLocation.to()
https://www.wix.com/velo/reference/wix-location

Now you are able to be redirected to your dynamic-page.

On the dynamic page an automatic Search-Process will be activated inside the —> onReady-Section.

You have already the code for the searching-process, all you will have to do are 5-steps.

  1. Get values of the dropdowns and inputs of your header.
  2. Save them into Wix-Storage.
  3. Redirect to your dynamic-page(all).
  4. Read the data out of Wix-Storage and put it into your Search-Function.
  5. Search-Function should be starting automaticaly when page is ready!

You are done! That was easy, wasn’t it?:grin::grin::joy: