
Hi All,
This is actually pretty easy to do but you need to be able to ftp into your site. You could use this to browse by any of your fields.
1) Create a page that is going to return a list of whatever it is you want to browse by
In the admin go to 'user pages' and click 'add new user page'. Fill in the details as follows
URI = /browse_homes_by_
X/ where X is something sensible eg type as this will appear in your page url.
Click the pass parameters box.
Title = Browse Homes by
X again where X is something sensible - this name appears int eh admin so you can recognise the file.
Template = index.tpl or another one you have created.
Module = classifieds.
Function = browse.
Level1field =
X where X is the field name of what ever it is you want to browse by.
listing_type_id = HomesForSale or another listing type depending on what you have created.
2) In the admin go to 'module types', 'classifieds' and find 'browse homes by state.tpl'. You need to create another one but you can not do it in the admin you have to ftp in.
In your ftp software go to root/templates/the template you are using/classifieds and copy 'browse homes by state.tpl'. Rename it (NB rename it to same as the URI you set in step1 without the slashes) and then ftp your new file back to root/templates/the template you are using/classifieds . It will now appear in the admin where you can edit it in the normal way.
In the admin go to 'module types', 'classifieds' and find 'browse homes by X.tpl'. Click on the edit button in the admin, you only need to make one change to the code which is highlighted in red below. Change 'state' to what ever is at the end of your uri eg if your URI is browse_homes_by_type X=type
<table id="browse_by_type" width=100%>
<tr>
{assign var="columnCount" value="4"}
{foreach from = $browseItems item = browseItem name=browseItems}
<td><a href="{$GLOBALS.site_url}/browse_homes_by_
X/{$browseItem.url}/">{$browseItem.caption} ({$browseItem.count})[/url]</td>
{if $smarty.foreach.browseItems.iteration % $columnCount == 0}</tr><tr valign=top>{/if}
{foreachelse}
<td>There is no listing with requested parameters in the system.</td>
{/foreach}
</tr></table>
Click change to save.
3) Make your browse by X appear on the home page (or any other page).
Go to ‘page templates’ and click ‘edit’ against which ever template you want to use - remember that main.tpl (not index.tpl) is the template for you home page. Locate where you want the new area to appear and paste in this code
<!--Properties by type-->
<div class="quickSearch">
<div class="quickSearchHeader"><h3>Properties By
Type</h3></div>
<div class="quickSearchKeep" >
{module name="classifieds" function="browse" level1Field='
PropertyType' browse_template='browse_homes_by_
type.tpl' listing_type_id='HomesForSale'} </div>
</div>
<!--Close properties by type-->
You only need to change the three bits in red - The code in the <h3> tags is simply the title for the section which will appear on your page so set this to something sensible. The second bit to change is the ‘level1field’. You set this in step one so use exactly the same name here - this is the field name that you want to browse by. The third change is referring to the uri which again you already used in step 1 and 2 so make sure this is consistent with what you did in those steps.
And that is it - fully functioning browse by any field.
Hope someone finds this useful.
Jen