The WorksForWeb Community Forums
Welcome to the WorksForWeb community forums. Here you can discuss WorksForWeb products with others and contribute to the rapidly growing WorksForWeb community. Please note that while WorksForWeb staff try to maintain presence on the forums, this is not the most reliable way to contact WorksForWeb staff. In case you require a timely response from WorksForWeb on an issue, please open a support ticket here. For pre-sales questions, please open a sales ticket here.

Welcome, Guest. Please login or register.
February 08, 2012, 12:38:58 AM

Login with username, password and session length
Search:     Advanced search
Added the iLister-related Boards

Rate My Site Boards Added

Merged iAuto and iRealty Support Forums together

Several new tips in the Tips and Tricks section
1,602 Posts in 623 Topics by 1,179 Members
Latest Member: bobsteam
* Home Help Search Login Register
+  The iAuto/iRealty/iLister Support Forum
|-+  iAuto, iRealty and iLister v.4.x
| |-+  iRealty Board
| | |-+  Modifying the browse by state function
« previous next »
Pages: [1] Print
Author Topic: Modifying the browse by state function  (Read 2158 times)
jenny
Newbie
*

Karma: 0
Posts: 7


View Profile
« on: May 07, 2008, 10:40:16 PM »

 Huh

Hi All,

As well as a 'browse by state' function I would like to have a browse by 'property type' function.  I have a field for each property called 'PropertyType' and it is set to one of four options, such as house or apartment.  I have edited the main.tpl from this

<div class="quickSearchKeep" >
      {module name="classifieds" function="browse" level1Field='State' browse_template='browse_homes_by_state.tpl' listing_type_id='HomesForSale'}   </div>

to this
      <div class="quickSearchKeep" >
      {module name="classifieds" function="browse" level1Field='PropertyType' browse_template='browse_homes_by_state.tpl' listing_type_id='HomesForSale'}   </div>

The good news is that my four property types have appeared on the home page with the number of each type in the database in brackets.  However when I click on one of these types it takes me to a search results page that displays the message "There is no listing with requested parameters in the system" rather than any of my properties.

Have missed something?

Cheers for any help.

Jen   
Logged
jenny
Newbie
*

Karma: 0
Posts: 7


View Profile
« Reply #1 on: May 08, 2008, 08:43:54 PM »

Grin

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
Logged
uniser
Newbie
*

Karma: 0
Posts: 10


View Profile
« Reply #2 on: May 16, 2009, 05:46:40 AM »

hi
i made that too but a much easier way, i added a line in the quick search template or property type field,
and that's all
i have other question that i will post now about type of offer
greetings
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Classified Software by Worksforweb Powered by SMF 1.1.8 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!