b. Listing Display Template Modification

Top  Previous  Next

 

In this section you will learn how to:

 

       • Add a Field to the Search Results Page;

 

       • Add a Field to the Listing Details Page.

 

By default the system contains two display templates:

 

       1. /templates/[Theme Name]/classifieds/job_info.tpl is used to display brief information on Job listings. E.g., such pages as Search Job Results, My Jobs, Browse by Job Category use this template.

 

       2. /templates/[Theme Name]/classifieds/display_job.tpl is used to display full information on job listings.

 

       3. /templates/[Theme Name]/classifieds/resume_info.tpl is used to display brief information on resumes. E.g., such pages as Search Resume Results, My Resumes use this template.

 

       4. /templates/[Theme Name]/classifieds/display_resume.tpl is used to display full information on resumes.

 

The administrator can add (or delete) fields to these templates to display changes on corresponding pages.

 

 

Add a Field to the Search Results Page

 

 

       To add a field to the Job Search Results Page, e.g. the 'Age' field after the 'Description' field. It is assumed that we have already created the 'Age' field via the admin panel:

 

       • Open /templates/[Theme Name]/classifieds/job_info.tpl

 

       • Locate the following code:

 

          {$listing.JobDescription|strip_tags|truncate:120|nl2br}

 

       This code displays the value of the 'Description' field.

 

       • After this code, insert the following lines:

 

          <br><strong>{$form_fields.Age.caption}:</strong> {$listing.Age}

 

       These lines display the value of the 'Age' field. (Pic.5.)

 

8

Pic.5. Modified Search Results Page.

 

 

 

Add a Field to the Listing Details Page

 

Suppose, we need to add a field to the Job Listing Details Page. We add the 'Age' field after the 'Salary' field. It is assumed that we have already created the 'Age' field via the admin panel:

 

       • Open /templates/[Theme Name]/classifieds/display_job.tpl

       

       • Locate the following code:

 

       <td>

       <strong>[[FormFieldCaptions!Posted]]:</strong> [[$listing.activation_date]]

       </td>

 

       This code displays the 'Posted' field (its caption and value). (Pic.6.)

 

       • After this code insert the following lines:

 

       <td>

       <strong>{$form_fields.Age.caption}:</strong> {$listing.Age}<br/>

       </td>

 

This code displays the 'Age' field (its caption and value). (Pic.6.)

 

9

Pic.6. Modified Listing Details Page.

 

 

Delete a Field from a Listing Display Template

 

If you want to delete a listing field from a listing display template find the code which displays the caption and value of this listing field and delete it from the file.