User Field Searching

Top  Previous 

User Fields: Ultimate Locator gives you 5 custom user fields for each location in your database. You may enter any type of text or html code into these user fields and they will display to your users (unless you have removed the user field placeholders from your templates).

To Turn On the use of User Fields, you must use the Program Settings Tool in the Admin Control Panel to enter descriptive labels for each field. Once you enter a label for a user field, that user field gets activated throughout your entire locator system.

Under Normal circumstances, you may want to enter text or html, and have this text or html simply display to your users as they search through your locations. You can enter things such as Manager Names, Business Hours, Coupon Info, Event Info, the list goes on. You can even use html code to display images. Anything you want to add, can be added. It's totally up to you to customize your results.

If you wish to allow your users to search your locations and to also specify a "Custom" criteria that is entered in your user fields, Ultimate Locator will allow it. Simply add a keyword trigger into your user field then add your form inputs to your index.htm template.

This will allow your visitors to select specific criteria along with their original search. For example; you can allow your visitors to enter their zip code and also select checkbox for additional search criteria. Ultimate Locator will then query the database for the zip code, and also for the user field that matches the selection. And only show results if both conditions are met.

 

How to Search: Setup your User Fields:

In this example, we are going to assume you are an automobile manufacturer that is maintaining a database of Car Lots. Each car lot can have New, Used and Lease vehicle types.

In order to allow your visitors to perform a zip code search and also select if they want to display only car lots that have "New" cars, then we need to setup 3 user fields to contain our keyword triggers.

In the Program Settings Tool, we would enter the following User Field Labels:

After you enter the above labels, you will designate the user1 field to be used for "New" cars, the user2 field to be used for "Used" cars and the user3 field for "Lease" cars.

Now for each record in our database, we can enter a value for each of these fields. Simply use the Add/Edit forms to add this information to each location or build into your import file before you import your locations.

If a location has New Cars, in the user1 field we would enter a keyword trigger of "Yes". If not, we would enter "No".

If a location has Used Cars, in the user2 field we would enter a keyword trigger of "Yes". If not, we would enter "No".

If a location has Lease Cars, in the user3 field we would enter a keyword trigger of "Yes". If not, we would enter "No".

Once you have the User Field Labels setup correctly and have your keyword triggers entered into your database, we then need to add the additional form elements to the index.htm template.

 

Add Search Options
to the index.php template:

Open up your index.htm template in your favorite text editor. We need to add 3 new checkboxes to the forms, so that your visitors can "Check Off" their additional search criteria.

Each search element (State search, Zip Code search, City search, Name search and Country search) is contained within it's own form tags. This means that if you wish to add Additional Search Criteria with User Fields, you will need to add the user field check boxes to each search element type.

Lets say we wish for our users to be able to place a checkmark for New, Used or Leased Cars when they perform a zip code search. We would add these form inputs (checkboxes in this case) to the Zip Code Search Element. You would want to place the following code between the <form> and </form> tags for the Zip Code Search Element. Just look for this in the html code and place your new form inputs in that section of the page:

<!-- ######  BEGIN ZIP CODE SEARCH BOX CODE #####  -->

<form name="form2" method="get" action="results_list.php">

Here is a sample of the form inputs we would add:

<input type="checkbox" name="user1" value="Yes"> New Cars <br>

<input type="checkbox" name="user2" value="Yes"> Used Cars <br>

<input type="checkbox" name="user3" value="Yes"> Lease Cars <br>

The important thing to remember here is: Whatever value you place in your location user fields, must be the same in the form input values. In our example, we use the keyword triggers "Yes" and "No". Therefore we would place "Yes" inside the value variable of each input like this: value="Yes"..

 

Final Results: The end result should look similar to the following when your index.php page is accessed with a browser:

q

Now your visitors can select additional search criteria when performing a search against your database. Ultimate Locator will only display results that meet the user's additional selections and is also in their zip code range.

You may want to add the additional search criteria form inputs to all your search elements. You may also use any type of input, such as radio buttons, check boxes, drop down lists or even text boxes.

 

Additional Tips: If you have more than 5 optional search elements or if you need to use the User Fields for other things, you can designate only 1 user field to become the "Keyword Trigger" for all your records.

For example: Lets say you have a database of locations for 20 different companies. And you want your users to be able to select a company from a drop down list then enter their zip code. The end result would be locations near the user that belong only to the company they selected.

You can use the User5 Field to contain the company name or code. Then you can put a new drop down list on your zip code form that contains the values you are entering into the User5 field for each record.

If you typed in "Company A" in the User5 field for a location. Then you your drop down list would need to be like the following example and place inside your zip code search form on your index.htm template.

<select name="user5">
<option value="Company A">Company A</option>
<option value="Company B">Company B</option>
</select>