REALTOR 747 - How to ... tips  
1. Mapping
2. Pagination - for listings.html
3. Menu Pages
4. Category List
5. Multi-level Category List
6. Search - Query Form, Result Pagination & Listings
7. Grouping - Features, Attributes, ... (V4.30+)

1. Mapping

[Admin] - [Setup] - [System Wide] - [Mapping Base URL]

%map_code% => Map Code
%map_address% => Address
%latitude% => Geocode - Latitude (V4.31+)
%longitude% => Geocode - Longitude (V4.31+)

Example.
Map Quest:http://www.mapquest.com/maps/map.adp?
country=US&zipcode=%map_code%&address=%map_address%
Google:http://maps.google.com/maps?q=%map_address%+%map_code%
Google:http://maps.google.com?f=d&q=%map_address% %map_code% @%latitude%,%longitude% (V4.31+)
Yahoo:http://maps.yahoo.com/maps_result?addr=%map_address%&csz=%map_code%&country=us

2. Pagination - for listings.html

[Admin] - [Setup] - [System Wide] - [# Of Listings Per Page - User]

-- The pagination is useful when there are too many listings in a category to display the listings in one page.
-- Note that the markers are available in "listings.html" only.
Markers for pagination
$llist_page_id              -- Page Number (ID) of The Listings Displayed
$llist_page_length          -- Number of Listings Per Page Set By Admin
$llist_pages as $ll_page
    $ll_page['id']          -- Page Number (ID)
    $ll_page['seq']         -- Page Sequence Number starting from 1
    $ll_page['link']        -- Link to The Page href value
    $ll_page['range_from']  -- Listing Range of the Page - From ex. 11
    $ll_page['range_to']    -- Listing Range of the Page - To ex. 20
Example 1
<!-- To see how it works, copy this demo into "listings.html" from here -->

[Listings Pagination Demo 1]
{loop $llist_pages as $ll_page loop}
    {if $llist_page_id == $ll_page[ 'id' ] if}
        <!-- no link for current page -->
        <b>[ {/ $ll_page[ 'range_from' ] /}-{/ $ll_page[ 'range_to' ] /} ]</b>
    {else}
        <a href={/ $ll_page[ 'link' ] /}>
            [ {/ $ll_page[ 'range_from' ] /} - {/ $ll_page[ 'range_to' ] /} ]
        </a>
    {/if}
{/loop}
<br>

<!-- To see how it works, copy this demo into "listings.html" to here -->
Example 2
<!-- To see how it works, copy this demo into "listings.html" from here -->

[Listings Pagination Demo 2]
{loop $llist_pages as $ll_page loop}
    {if $llist_page_id == $ll_page[ 'id' ] if}
        <!-- no link for current page -->
        <b>Page {/ $ll_page[ 'id' ] /}</b> 
    {else}
        <a href={/ $ll_page[ 'link' ] /}>Page {/ $ll_page[ 'id' ] /}</a>
    {/if}
{/loop}
<br>

<!-- To see how it works, copy this demo into "listings.html" to here -->

3. Menu Pages

-- These markers are available for all template files.
Example 1. Simple
{loop $pages as $page loop}
    <a href="{/ $page['link'] /}">{/ $page['name'] /}</a> &nbsp;
{/loop}
Example 2. Check current page
{loop $pages as $page loop}
    {if ( $page_id == $page['id'] ) if}
        <b>{/ $page['name'] /}</b>
    {else}
        <a href="{/ $page['link'] /}">{/ $page['name'] /}</a>
    {/if}
    &nbsp;
{/loop}

4. Category List

-- These markers are available for all template files.
Example 1. Simple
{loop $cats as $cat loop}
    <a href="{/$cat['link']/}">
        {/$cat['name']/} - {/$cat['howmany']/}
    </a><br>
{/loop}
Example 2. Check current category
{loop $cats as $cat loop}
    {if $cat['name'] == $llist_category_name if}
        <b>{/$cat['name']/} - {/$cat['howmany']/}</b><br>
    {else}
        <a href="{/$cat['link']/}" > 
            {/$cat['name']/} - {/$cat['howmany']/}
        </a><br>
    {/if}
{/loop}

5. Multi-level Category List

-- These markers are available for all template files.

For exmple, you want a category structure like this:

Commercial:
  • Category 1
  • Category 2
Residential:
  • Category 3
  • Category 4

The script provides single level category structure for the sake of simplicity. However, you can present it on front ends as if it is a multi level structure.

The basic idea is that you get a category id when you create a category. We can utilize that id.

Assuming that category id 1, 2 are for commercial listings and 3,4 are for residential listings, hear are a couple of examples:
Example 1. Use categoryid parameter directly.
Commercial:<br>
 - <a href="{/ $it747_home /}/index.php?pageid=2&categoryid=1" > Category 1 </a><br>
 - <a href="{/ $it747_home /}/index.php?pageid=2&categoryid=2" > Category 2 </a><br>

<br>

Residential:<br>
 - <a href="{/ $it747_home /}/index.php?pageid=2&categoryid=3" > Category 3 </a><br>
 - <a href="{/ $it747_home /}/index.php?pageid=2&categoryid=4" > Category 4 </a><br>
Example 2. More flexible way using markers.
Commercial:<br>
{loop $cats as $cat loop}

{if $cat['id'] == 1 if} - <a href="{/ $cat['link'] /}" > {/ $cat['name'] /} - {/ $cat['howmany'] /} </a><br>{/if}
{if $cat['id'] == 2 if} - <a href="{/ $cat['link'] /}" > {/ $cat['name'] /} - {/ $cat['howmany'] /} </a><br>{/if}

{/loop}

<br>

Residential:<br>
{loop $cats as $cat loop}

{if $cat['id'] == 3 if} - <a href="{/ $cat['link'] /}" > {/ $cat['name'] /} - {/ $cat['howmany'] /} </a><br>{/if}
{if $cat['id'] == 4 if} - <a href="{/ $cat['link'] /}" > {/ $cat['name'] /} - {/ $cat['howmany'] /} </a><br>{/if}

{/loop}

6. Search

6.1 Search - Query Form

-- These markers are available for all template files.
Markers for search form
$search_action              -- action target (points to search.html)
                            -- <form action="{/ $search_action /}" .. >

                            -- All the $select_* markers are optional.
                            -- But, at least, one of them must exist.

$select_category            -- Select Category          -- optional
$select_area                -- Select Area              -- optional
$select_bedroom             -- Select Bedroom           -- optional
$select_bathroom            -- Select Bathroom          -- optional
$select_price_from          -- Select Price - from      -- optional
$select_price_to            -- Select Price - to        -- optional
$select_page_size           -- Select Result Page Size  -- optional
Example 1. Simple
<form method="POST" action="{/ $search_action /}">
    Budget : {/ $select_price_to /}
    <input type="submit" value="Go">
</form>
Example 2. Using all avaliable $select_* queries
<form method="GET" action="{/ $search_action /}">

<b>Search Your New Home</b><br><br>

<table>
 <tr>
  <td>Category</td><td>{/ $select_category /}</td>
  <td>Area</td><td>{/ $select_area /}</td>
 </tr>

 <tr>
  <td>Bedroom</td><td>{/ $select_bedroom /}</td>
  <td>Bathroom</td><td>{/ $select_bathroom /}</td>
 </tr>

 <tr>
  <td>Price From</td><td>{/ $select_price_from /}</td>
  <td>To</td><td>{/ $select_price_to /}</td>
 </tr>

 <tr>
  <td>Page Size</td><td>{/ $select_page_size /}</td>
  <td></td>
  <td><input type="image" src="icon-search.gif" border="0"></td>
 </tr>

</table>
</form>

6.2 Search - Result Pagination - for search.html

-- This pagination for search result is very similar to the pagination for listings.html.
-- Note that the markers are available in "search.html" only.
Markers for search result pagination
$srlist_result              -- Search Result Provided ? [true / false]

$srlist_total               -- Total # of Listings Found
$srlist_page_length         -- Search Result Page Size
$srlist_page_id             -- Current Result Page ID
$srlist_from                -- Current Result Set - from
$srlist_to                  -- Current Result Set - to

$srlist_pages as $ll_page   -- Pagination of The Listings   -- Search Result
    $ll_page['id']          -- Page Number (ID)
    $ll_page['seq']         -- Page Sequence Number starting from 1
    $ll_page['link']        -- Link to The Page href value
    $ll_page['range_from']  -- Listing Range of the Page - From ex. 11
    $ll_page['range_to']    -- Listing Range of the Page - To   ex. 20
Example 1. Pagination
<!-- To see how it works, copy this demo into "search.html" from here -->

[Search Result Pagination Demo 1]
{loop $srlist_pages as $ll_page loop}
    {if $srlist_page_id == $ll_page[ 'id' ] if}
        <!-- no link for current page -->
        <b>[ {/ $ll_page[ 'range_from' ] /}-{/ $ll_page[ 'range_to' ] /} ]</b>
    {else}
        <a href={/ $ll_page[ 'link' ] /}>
            [ {/ $ll_page[ 'range_from' ] /} - {/ $ll_page[ 'range_to' ] /} ]
        </a>
    {/if}
{/loop}
<br>

<!-- To see how it works, copy this demo into "search.html" to here -->
Example 2. Pagination
<!-- To see how it works, copy this demo into "search.html" from here -->

[Listings Pagination Demo 2]
{loop $srlist_pages as $ll_page loop}
    {if $srlist_page_id == $ll_page[ 'id' ] if}
        <!-- no link for current page -->
        <b>Page {/ $ll_page[ 'id' ] /}</b>
    {else}
        <a href={/ $ll_page[ 'link' ] /}>Page {/ $ll_page[ 'id' ] /}</a>
    {/if}
{/loop}
<br>

<!-- To see how it works, copy this demo into "search.html" to here -->
Example 3. Pagination + Stat used in white2 or white3 template
{if ( $srlist_result && $srlist_total < 1 ) if}
 <div class="notice_search_result">
    No listings found. Search with different criteria, please.
 </div>
{/if}

{if ( $srlist_result && $srlist_total > 0 ) if}
 <div class="notice_search_result">
    Search Result: [ {/ $srlist_total /} ] listings found.
    Displaying [ {/ $srlist_from /} - {/ $srlist_to /} ]
 </div>

 <div class="page">
 Page :
 {loop $srlist_pages as $ll_page loop}
    {if $srlist_page_id == $ll_page[ 'id' ] if}
        <!-- no link for current page -->
        <b>{/ $ll_page[ 'id' ] /}</b>&nbsp;
    {else}
        <a href={/ $ll_page[ 'link' ] /}>{/ $ll_page[ 'id' ] /}</a>&nbsp;
    {/if}
 {/loop}
 </div>

{/if}

6.3 Search - Result Listings - for search.html

-- The search result listings for search.html is very similar to the listings for listings.html.
-- Note that the markers are available in "search.html" only.
Markers for search result listings
$srlist as $ll      -- Search Result Listings List
    ll['id']        -- Listing ID
    ...             -- The same as "$llist as $ll" in "Listings in a category"
Example 1. Simple
{loop $srlist as $ll loop}
    Seq: {/ $ll['seq'] /}<br>
    Property Name: {/ $ll['name'] /}<br>
    Catch Phrase: {/ $ll['catch_phrase'] /}<br>
    Agent: {/ $ll['agent_name'] /}<br>
    <br>
{/loop}
-- For more complete example, please look at the 'search.html' in white2 or white3 template.

7. Grouping - Features, Attributes, ... (V4.30+)

-- You can apply this approach to other data (attributes, documents ..) as long as they have a "(List) Order" field.
-- See below for a complete list.

Suppose that you want to split features of a listing into several groups, for example "exterior" and "interior".

You can do it by utilizing the "(List) Order" of features. As an example, this implementation is that

- if the "Order" number is smaller than 100, it belongs to "Interior"
- if the "Order" number is bigger than 100, it belongs to "Exterior"

1. Setup features

[Admin] - [Setup] - [Features]. Look at the "order" number carefully.


2. Input fetaures for a listing

[Admin] - [Listings] - Select a Listing - [Listing Edit] - [Features]


3. Template code
Grouping features. In detail.html
<p class="feature_head">Interior Features</p>
<ul>
{loop $l_features as $l_feature loop}
    {if $l_feature['list_order'] < 100 if}
        <li class="feature">{/$l_feature['name']/}</li>
    {/if}
{/loop}
</ul>

<p class="feature_head">Exterior Features</p>
<ul>
{loop $l_features as $l_feature loop}
    {if $l_feature['list_order'] > 100 if}
        <li class="feature">{/$l_feature['name']/}</li>
    {/if}
{/loop}
</ul>

4. Output (Template)




** List of data sets to which you can apply this approach:

DataSample Markers
 
listing itself$llist as $ll .. $ll['list_order']
listing - features$l_features as $l_feature .. $l_feature['list_order']
listing - attributes$l_attrs as $l_attr .. $l_attr['list_order']
listing - documents$l_docs as $l_doc .. $l_doc['list_order']
listing - images$l_images as $l_image .. $l_image['list_order']
listing - virtual tours$l_tours as $l_tour .. $l_tour['list_order']
listing - area$l_area_list_order
about list$abouts as $about .. $about['list_order']
agent list$agents as $agent .. $agent['list_order']
category list$cats as $cat .. $cat['list_order']
page list$pages as $page .. $page['list_order']
service list$svcs as $svc .. $svc['list_order']



Copyright © 2003-2010 IT747.COM