c. Listing Search Form Modification

Top  Previous  Next

 

In this section you may find instructions how to modify the listing search forms:

 

       • Add a Listing Field to a Search Form;

 

       • Delete a Listing Field from a Search Form;

 

       • Create a Page Contained Listing Search Form;

 

       • Add a New Search Form to Each Page.

 

 

By default the system contains four types of  listing search forms:

 

       1. Quick search form for Jobs,

 

       2. Advanced search form for Jobs,

 

       3. Search form for Resumes,

 

       4. My Listings search form (My Jobs and My Resumes).

 

 

The following templates are used for these forms.

 

       1. The /templates/[Theme Name]/classifieds/quick_search.tpl  file is used to display Job Quick search form.

 

       2. The /templates/[Theme Name]/classifieds/search_form.tpl  -   for Advanced job search  form.

 

       3. The /templates/[Theme Name]/classifieds/search_form_resume.tpl  -   for resume search  form.

 

       4. The /templates/[Theme Name]/classifieds/my_listings_form.tpl  -   for My Listings search  form.

 

 

 

See the default  job quick search form on the Pic.7. The listing search forms use the syntax which you can see in the notes (Pic.7.) to display the fields. The administrator can change field names, delete existing fields and add new fields to these forms.

 

 

If you want to modify these forms follow the instructions given below for the quick search form.

 

 

5

Pic.7. Default Quick Search Form.

 

 

Add a Listing Field to a Search Form

 

       To display a listing field caption on a search form use the syntax:

 

               {$form_fields.ListingFieldID.caption}.

 

       To display a search field on a search form use the syntax:

 

               {search property = ListingFieldID template = [Your Template Name]}

 

If you do not specify the template (template = [Your Template Name]), the system will display the default template of a type.

 

E.g., to display the caption of the 'Country' field (list type) on the default quick search form, use the syntax:

 

               {$form_fields.Country.caption}. (Pic.8.)

 

       To display 'Country' search field use the syntax:

 

               {search property=Country}

 

 

       To add a listing field to the quick search form, e.g., 'Country' field:

 

       • Open the   /templates/[Theme Name]/classifieds/quick_search.tpl file and locate there the code:

 

               <p>[[FormFieldCaptions!State]]</p>

 

 

       • After this code insert the code:

 

               <p>{$form_fields.Country.caption}</p>

 

 

       • And in this file locate there the code:                

 

               <div class="stateForm">{search property=State}</div>

 

 

       • After this code insert the code:

 

               <P><div class="countryForm">{search property=Country}</div></p>

 

 

       This code displays the 'Country' field (its caption and input box).

 

 

On the Pic.8. you may see how the 'Country' field will be displayed on the quick search form.

 

 

6

Pic.8. Added Listing Field.

 

 

Delete a Listing Field from a Search Form

 

If you want to delete a listing field from a search form find the code which displays the caption and exterior view of this listing field and delete it from the file.

 

 

Create a Page Contained Listing Search Form

 

To create an additional page with a search form, e.g., the 'Power Search' page with the search form contains all listing fields even those which are not included in the advanced search form:

 

               • Create the 'power_search.tpl'  file in the /templates/[Theme Name]/classifieds/ folder with the code from the /templates/[Theme Name]/classifieds/search_form.tpl  file.

 

               • Add the additional fields (their captions and input boxes) to this file. Use the syntax given above (See 'Add a Listing Field to a Search Form').

       

               • Go to Admin Panel -> Templates -> Site Pages

 

               • Create the '/power_search/' page where 'URI' = '/power_search/', 'Module' = 'classifieds', 'Function' = 'search_form', Parameters: 'listing_type_id' = 'Job' , 'form_template' ='power_search.tpl' .

 

To display this page on your site place a link with the  '[Your_Site_URL]/power_search/'  URL in any section of your site.

 

 

Add a New Search Form to Each Page

 

To add a new search form to each page of your site, e.g., to make a quick search only by State ('My New Search' form):

 

               • Create the  'my_new_search.tpl'  file in the /templates/[Theme Name]/classifieds/ folder with the following code:

 

               <form method="post" action="{$GLOBALS.site_url}/search_results">

               <table>

                          <tr>

                                  <td align="left" style="font-weight:bold">Find Job by State</td>

                          </tr>

                          <tr>

                                  <td>{search property=State}</td>

                          </tr>

                          <tr>

                                <td align="left"><input type="submit" class="button" style="width:100px" value="Find"/></td>

                          </tr>

               </table>

               </form>

 

This code displays the newly created 'My New Search' form with the following components: the 'Find Job by State' caption, drop down 'State' list and the 'Find' button (Pic.9.).

 

 

To add a new search form to each page of your site you need to modify /templates/[Theme Name]/main main.tpl , /templates/[Theme Name]/main/index.tpl:

 

               • In  the /templates/[Theme Name]/main/main.tpl (the main page) , /templates/[Theme Name]/main/index.tpl (other front end pages)  locate the code:

 

               <div class="rightPanelTitle">&nbsp;&nbsp;[[Jobs by City]]</div>

               {module name="classifieds" function="browse" level1Field="City" listing_type_id="Job" browse_template="browse_by_city.tpl"}

 

 

               This code displays the 'Jobs by City'.

 

 

               • After this code insert the lines:

 

               <br><br><div style="float: left; width:150px;">

               {module name="classifieds" function="search_form" form_template="my_new_search.tpl" listing_type_id="Job"}

               </div>

 

               This code displays the newly created 'My New Search' form.

 

 

Pic.9. shows the tiny search form will be displayed on the main page.

 

7

 

Pic.9. My New Search Form on Each Page