Search Link in Field

8 posts by 2 authors in: Forums > CMS Builder
Last Post: July 9, 2010   (RSS)

Re: [fleff] Search Link in Field

By Jason - July 8, 2010

Hi Farnham,

One things you can try is, instead of using the agent's name, you could use the agent's user number. In the example you gave, if you have two agents for example: Peter Smith, Peter Jones, This query would return the records for both of them.

If each listing has an agent number attached to it, you could try something like this:
"/houses.php/status_keyword=For+Sale&agent=4"

Where agent is the name of the agent field in the listings table.

Give this a try. If you're still having trouble, could you please provide a link to the listings page where you're having the problem and attach houses.php so I can take a closer look.

Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Search Link in Field

By fleff - July 8, 2010

Thanks, Jason, for your very prompt response. I understand your suggestion about using an ID instead of a single name. I used "Peter" only as an example. What I would like to do is use the record number.

I've tried everything I can think of to make this work. There's probably some simple thing I'm overlooking. I've attached the houses.php file as you requested. Here is the link to the page giving me the trouble: http://klemmrealestate.com/agents_details.php
You will see here the various ways I've tried to get it to work. Neither page is finished yet.

Thanks for checking it.

Farnham

Re: [fleff] Search Link in Field

By Jason - July 8, 2010

Hi Farnham,

Could you attach the agent_details.php and the houses.php files so that I can take a look at the code being used?

thanks
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Search Link in Field

By fleff - July 8, 2010

Sorry, Jason, I thought I had attached them. I forgot to click the Upload Attachment button after choosing them.

Farnham
Attachments:

agents_details.php 17K

houses.php 15K

Re: [fleff] Search Link in Field

By Jason - July 9, 2010

Hi Farnham,

I'm going to need to be able to see how your scripts are actually running. If you could email your CMS Builder login and FTP information to jason@interactivetools.com I can take a closer look.

Please only email this information, don't post it to the forum.

Thanks.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [fleff] Search Link in Field

By Jason - July 9, 2010

Hi Farnham,

I think I found the problem. The automatic search functionality of CMS Builder only words when URL variables use the same names as the field names in the database. In this case, the field in the listings table that holds the name(s) of the people listing the property is called "listed_by".

So if you wanted to get all of the properties with a status of "For Sale" that are listed by an agent with Peter in their name, you could use:
/houses.php/status_keyword=For+Sale&listed_by_keyword=Peter


Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Search Link in Field

By fleff - July 9, 2010

That's it, Jason! I should have thought of that. I'll know better next time (maybe). Thanks a million.

Farnham