 |

MAGSGQ
User
Dec 13, 2002, 10:25 AM
Post #1 of 20
(11076 views)
Shortcut
|
|
Dynamic DropDown Menu for search
|
Can't Post
|
|
I noticed _search_query.html allows you do create a menu for users. Is there anyway possible to generate a dropdown menu that holds a list of addresses from lfield1 ??? Let me maybe explain more clearer. The Client wants to include a dropdown menu of all 'Addresses' in the dbase. Therefore, I need to link these addresses to their respective records. Any suggestions please?
(This post was edited by MAGSGQ on Dec 16, 2002, 5:22 AM)
|
|
|  |
 |

Benjamin
Staff

Dec 16, 2002, 3:02 PM
Post #2 of 20
(11040 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)
|
|
Attachments:
|
_address_search.html
(2.51 KB)
|
|
|  |
 |

MAGSGQ
User
Dec 17, 2002, 7:08 AM
Post #3 of 20
(11025 views)
Shortcut
|
|
Re: [Benjamin] Dynamic DropDown Menu for search
[In reply to]
|
Can't Post
|
|
Damn genius I swear. I have downloaded the updated version of RM/AM but have not built up enough courage to do it. Is it an easy install? Look forward to trying this out. I appreciate the reply Ben.
|
|
|  |
 |

MAGSGQ
User
Dec 18, 2002, 5:54 AM
Post #4 of 20
(11004 views)
Shortcut
|
|
Re: [Benjamin] Dynamic DropDown Menu for search
[In reply to]
|
Can't Post
|
|
Here is my next dumb question. How can I use this feature in my _search_query.html template??? BTW: it is working if I hit the url but if I try to incorporate code into the search query file and does not seem to work. Any ideas? Maybe my placements are out of whack? I have uploaded the search query file for your viewing.
(This post was edited by MAGSGQ on Dec 18, 2002, 6:16 AM)
|
|
Attachments:
|
_search_query.html
(18.2 KB)
|
|
|  |
 |

Benjamin
Staff

Dec 18, 2002, 9:58 AM
Post #5 of 20
(10992 views)
Shortcut
|
|
Re: [MAGSGQ] Dynamic DropDown Menu for search
[In reply to]
|
Can't Post
|
|
Hi! I had a look at your file and everything seemed okay, except there was an extra <form> tag stuck in there. I've attached a new version which worked for me. I think your problem may be the following: while it may seem backwards, what you have to do is pass your _search_query2.html page into the search engine. So all links to the search page should look something like this: http://www.yourwebsite.com/path/to/search.cgi?search=1&perpage=10&template=_search_query2.html So in effect, your site visitor, prior to even searching for houses will have done a search just to get the search page! Post me back if you have further problems. Ben interactivetools.com
(This post was edited by Benjamin on Dec 18, 2002, 9:59 AM)
|
|
Attachments:
|
_search_query2.html
(18.2 KB)
|
|
|  |
 | |  |
 |

pfoley
User
Feb 14, 2003, 8:25 AM
Post #7 of 20
(10781 views)
Shortcut
|
|
Re: [Benjamin] Dynamic DropDown Menu for search
[In reply to]
|
Can't Post
|
|
This works great for a dropdown that has a 1 to 1 relationship to the number of records - is there a way to make it work with a subset of records ... specifically, I want a dropdown of cities that exist in the records. Obviously, I just want the unique values, not every value in the dropdown. If there is a way to generate this dynamically with a search template, that would be ideal. Otherwise, I figure I'll have to do some Perl hacking with rm-db.cgi. Thanks. Patrick Foley
|
|
|  |
 |

Benjamin
Staff

Feb 23, 2003, 4:14 PM
Post #8 of 20
(10687 views)
Shortcut
|
|
Re: [pfoley] Dynamic DropDown Menu for search
[In reply to]
|
Can't Post
|
|
Hi Patrick, Sorry for not responding earlier; I managed to miss your post! Urgh. It's an interesting but tricky problem... I think a server side-solution would probably be your best bet. Having said that, how's your javascript? I could suggest a possible option, but it may prove pretty tricky... and (of course) would only work for javascript-enabled browsers. Ben interactivetools.com
|
|
|  |
 |

pfoley
User
Feb 23, 2003, 6:23 PM
Post #9 of 20
(10682 views)
Shortcut
|
|
Re: [Benjamin] Dynamic DropDown Menu for search
[In reply to]
|
Can't Post
|
|
I ended up doing a server side solution, and it works great. After realizing how the search worked for a given address, I realized that's probably not appropriate for 1500 listings anyway! I was thinking of making an associative array (just an Object) and collecting all the unique city names, then building a dropdown dynamically. Ended up doing largely the same thing in Perl, with a hash and a static dropdown, since I'm already preprocessing my listings anyway. Thanks for the input. Patrick
|
|
|  |
 |

MAGSGQ
User
Aug 15, 2003, 11:40 AM
Post #10 of 20
(10445 views)
Shortcut
|
|
Re: [Benjamin] Dynamic DropDown Menu for search
[In reply to]
|
Can't Post
|
|
Ben, hate to bring this antiquated subject up again but what reasons would make the DROPDOWN not prepopulate on the jumpbox? No code has changed AT all. If you load the page once, the dropdown is empty........if you go somewhere else in the site THEN come back to the search query page, the dropdown is working properly? Any ideas.?
|
|
|  |
 |

Benjamin
Staff

Aug 15, 2003, 12:29 PM
Post #11 of 20
(10444 views)
Shortcut
|
|
Re: [MAGSGQ] Dynamic DropDown Menu for search
[In reply to]
|
Can't Post
|
|
Hi MAGSGQ, No worries - nice to hear from you! The most likely cause would be due to the search query not returning any results... but you say it works when returning to the page? Compare the URL of the page which doesn't work, with the one that does. Are they the same? In order to prepopulate the dropdown list, you actually have to go through the search engine in the first place - that returns those address values which are inserted into the jumpbox dropdown. If the URLs are different as I suspect, you'll need to replace any links to the faulty search query page with the correct one. If you're still having no luck, post me back! :-) Ben interactivetools.com
|
|
|  |
 | |  |
 |

MikeB
Staff
/ Moderator

Mar 12, 2005, 4:15 PM
Post #14 of 20
(7992 views)
Shortcut
|
|
Re: [compusol] Dynamic DropDown Menu for search
[In reply to]
|
Can't Post
|
|
Hi Phil, Thanks for the post! I took a look at your site and it looks like you're only seeing 10 of your listings because of the search query string you're seeing. By default the search is set up to return 10 results perpage and that's why you're only seeing these 10 results. If you'd like to see more you could try using a search query that looked something like this: http://www.crownleafspain.com/cgi-bin/listman/exec/search.cgi?search=1&template=_address_search.html&perpage=9999 I tried this out and it looks like it shows all of your listings in the dropdown menu. I hope this helps and if you have any other questions feel free to let me know! Cheers, Mike Briggs - Product Specialist support@interactivetools.com
Hire me! Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.
|
|
|  |
 |

compusol
New User
Mar 13, 2005, 1:04 AM
Post #15 of 20
(7972 views)
Shortcut
|
|
Re: [MikeB] Dynamic DropDown Menu for search
[In reply to]
|
Can't Post
|
|
Cheers Mike, works perfectly, thanks for such a prompt response. Phil Creative Webs
|
|
|  |
 |

damsel
User
Aug 29, 2005, 12:46 PM
Post #16 of 20
(6253 views)
Shortcut
|
|
Re: [compusol] Dynamic DropDown Menu for search
[In reply to]
|
Can't Post
|
|
I can't get this to work......I am trying to search by hfield1 from the Homepage listings. My hfield1 is setup as a category drop down. I can get it to list the companies but not the categories. http://www.edcstlucie.org/cgi-bin/rm/exec/search_homepage.cgi Thanks, Samantha
(This post was edited by damsel on Aug 29, 2005, 1:26 PM)
|
|
|  |
 |

Cliff
Staff

Aug 30, 2005, 9:25 AM
Post #17 of 20
(6220 views)
Shortcut
|
|
Re: [damsel] Dynamic DropDown Menu for search
[In reply to]
|
Can't Post
|
|
Hi Samantha, Thanks for posting. There isn't going to be an easy way to dynamically update a list of categories, so I think that the quickest and easiest thing to do in this case would be to hard code the list on the search query page, and update it as needed when you add or remove a category. The methods that are described in this post will end up giving you duplicate results for your categories, so that's why hard coding is a better option in your case. I hope that helps explain, but let me know if you need any more details. Regards, Cliff Stefanuk - Customer Service Manager support@interactivetools.com
|
|
|  |
 |

damsel
User
Aug 30, 2005, 10:21 AM
Post #18 of 20
(6216 views)
Shortcut
|
|
Re: [Cliff] Dynamic DropDown Menu for search
[In reply to]
|
Can't Post
|
|
Hmm....I don't understand really. If I can look at a list of the categories in the admin area, why can't I pull that list into a dropdown? The data must be stored somewhere. I would really rather not do the hard coded list if at all possible. Thanks!
|
|
|  |
 |

ross
Staff
/ Moderator

Aug 31, 2005, 11:51 AM
Post #19 of 20
(6190 views)
Shortcut
|
|
Re: [damsel] Dynamic DropDown Menu for search
[In reply to]
|
Can't Post
|
|
Hi Samantha. Thanks for keeping in touch . The way you normally bring data from Listings Manager’s database into a template is with a placeholder. While there are placeholders for the actual value stored in one of your custom fields there aren’t actually placeholders for the names of the fields themselves. In a situation like this, Cliff’s idea is going to work the best as it will give you a lot more control over which options your visitors end up having. Would you be able to give it shot and see how it works? If you need a hand, just let me know . ----------------------------------------------------------- Cheers, Ross Fairbairn - Product Specialist support@interactivetools.com
Hire me! Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.
|
|
|  |
 |

damsel
User
Sep 1, 2005, 6:05 AM
Post #20 of 20
(6153 views)
Shortcut
|
|
Re: [ross] Dynamic DropDown Menu for search
[In reply to]
|
Can't Post
|
|
I think the problem is that I didn't clarify what I'm doing. I'm trying to use this with search_homepage.cgi not search.cgi. In any case, the company drop down doesn't actually work either, it puts the url in the first option and none of the proceeding ones. http://www.edcstlucie.org/cgi-bin/rm/exec/search_homepage.cgi
(This post was edited by damsel on Sep 1, 2005, 6:19 AM)
|
|
|  |
|