Display both featured and open houses on same page

4 posts by 3 authors in: Forums > CMS Builder
Last Post: May 13, 2010   (RSS)

By DanMaitland - May 12, 2010

Ok so here is my question/problem. I have a real estate site where on the home page I have 6 Featured properties and also on the same page properties that are holding Open Houses. I have check boxes in the listings section for both Featured and another for Open House.

My problem is that for some reason only 2 of the three properties that have the "Open House" check box checked are displaying. how can I get it to display any and all properties that have the Open House check box checked? Also is there any way of limiting the Featured properties to 6. I hope that I am being clear.

Here is the url to the page in question and I have attached the file in question.

http://www.gselection.com/dev/home.php
Attachments:

index_018.php 8K

Re: [Dan Maitland] Display both featured and open houses on same page

By Kenny - May 12, 2010 - edited: May 12, 2010

Dan,

This is untested for your needs, but I'm thinking it's what you need.

Basically you'll need to call for the properties twice in pre-head code. Once like you have it for the featured properties:

list($listingsRecords, $listingsMetaData) = getRecords(array(
'tableName' => 'listings',
'where' => 'featured = 1',
'perPage' => '6',

));


Then once again for the open house properties like this:

list($openListingsRecords, $openListingsMetaData) = getRecords(array(
'tableName' => 'listings',
'where' => 'open house = 1',

));


Your for each statement will need to be adjusted for the open house records like this:

<?php foreach ($openListingsRecords as $record): ?>

code here....

<?php endforeach; ?>



Make sense? In the first call you are using $listingsRecords and in the second call you are using $openListingsRecords


You may have to make a few adjustments to fit your situation, but the concept is the same.


Kenny

Re: [Dan Maitland] Display both featured and open houses on same page

By Toledoh - May 12, 2010

Hi dan. I'm not at my computer so I can't go into detail, however Im doing a similar thing at present and thought it may be of interest.

I've got a second section that sits apart from the listing which is titled open houses. Within this section is just start and end dates and a pick list of the listings. This way I can list multiple open houses for the one listing.

Then, using the relative lookup function I can show edit and delete open houses from the edit screen on the listings.

This makes it easy for me to list them, ie on the home page, but also For instance on a google map view.

I know this doesn't answer your question, just food for thought.
Cheers,

Tim (toledoh.com.au)