
Benjamin
Staff

Dec 16, 2002, 3:02 PM
Post #2 of 20
(15861 views)
Shortcut
|
|
Re: [MAGSGQ] Dynamic DropDown Menu for search
[In reply to]
|
Can't Post
|
|
Hi, Yes, this can be done - but you'll need two things: (1) the latest version of Realty Manager / Auto Manager, and (2) an add-on script called "jumpbox.cgi". The solution is kind of sneaky. It gives new purpose to "jumpbox.cgi", which we use all over our website. (For example, http://www.interactivetools.com/freescripts/ - The top-left dropdown menu makes use of our jumpbox script.) The script is really rather neat. First, it tries to redirect you with javascript, but if that doesn't work (i.e. if javascript had been disabled on the visitor's browser), it relies on a server-side code to redirect you. We're going to use the same program in your case. First, download the jumpbox.cgi script. This contain instructions on how to install it on your server. Now you're going to want to dynamically populate your dropdown menu by querying the search engine, asking for all listings and specifying a new template to draw the results with. This template will be used to draw the dropdown, each <option> being a property address with a corresponding URL. (And don't forget it belongs in the /templates/ directory!) Rather than go into details about how to create this file, it's far easier for you to just see how I did it, and copy the relevant parts into your own page. In general terms, each template cell is creating a separate <option> tag for each listing, with the value being the URL and the text being the address. I've attached my template file _address_search.html to show you how I did it. You probably won't need to modify it that much, but you will have to make sure the action tag of the form is correctly pointing to the jumpbox script. So now all this is done, to get your dropdown page working, you'll need to hardcode a link into some page somewhere looking like this: http://www.yourwebsite.com/location/of/your/search.cgi?search=1&template=_address_search.html Then, if all goes well, you'll see your dropdown menu populated with address fields. I hope this works for you. Do tell us if you get it going - or run into any problems! Ben interactivetools.com
(This post was edited by Benjamin on Dec 16, 2002, 3:07 PM)
|