Display both featured and open houses on same page

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

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)

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.