Listing Display Template Modification

Top  Previous  Next

In this section you will learn how to:

 

 

 

By default, the system contains two display templates:

1.

/templates/[Theme Name]/classifieds/listing_info.tpl is used to display brief information on listings. E.g., such pages as Search Results, My Listings, Browse Homes by State, Browse Rentals by State  use this template.

2.

/templates/[Theme Name]/classifieds/listing_details.tpl is used to display full information on listings. E.g., such pages as Listing Details, Print Listing  use this template.

 

The administrator can add (or delete) fields to these pages.

 

 

Add a Field to the Search Results Page

 

To add a field to the Search Results Page, e.g. the 'Number of Floors' field after the 'Square Feet' field:

Open /templates/[Theme Name]/classifieds/listing_info.tpl

Locate the following code:

 

            {if $listing.SquareFeet}

                    Square Feet: {$listing.SquareFeet} | 

            {else}

            {/if}

 

    This code displays the value of the 'Square Feet' field. (Pic.5.)

After this code, insert the following lines:

 

            {if $listing.NumberOfFloors}

                    Number of Floors: {$listing.NumberOfFloors} | 

            {else}

            {/if}

 

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

 

 

search_results_modified

 

Pic.5. Modified Search Results Page.

 

Note: The above changes to the 'Search Results' page will be also displayed on the 'My Listings' page.  

 

 

Add a Field to the Listing Details Page

 

Suppose, we need to add a field to the Listing Details Page. We add the 'Distance to Downtown' field after the 'Number of Floors' field. It is assumed that we have already created the 'Distance to Downtown' field via the admin panel:

Open /templates/[Theme Name]/classifieds/listing_details.tpl

Locate the following code:

 

    <tr><td><b>Floors:</b> {$listing.NumberOfFloors}</td></tr>

 

    This code displays the 'Number of Floors' field (its caption and value). (Pic.6.)

After this code, insert the following lines:

 

    <tr><td><b>{$form_fields.DistanceToDowntown.caption}:</b> {$listing.DistanceToDowntown}</td></tr>      

 

This code displays the 'Distance to Downtown' field (its caption and value). (Pic.6.)

 

listing_details

 

Pic.6. Modified Listing Details Page.

 

Note: The above changes to the 'Listing Details' page will be also displayed on the 'Display Listing' 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.