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: [sagentic] Display both featured and open houses on same page

By DanMaitland - May 13, 2010

Worked like a charm. Thank you so much for the ultra speedy response.