Featured rental listings

7 posts by 2 authors in: Forums > CMS Builder
Last Post: April 26, 2009   (RSS)

By _kate_ - March 28, 2009

On a real estate website with a field for rentals and sales, what would be the smartest way to feature one from each section on the front page of the website?

Would like the client to be able to choose which should show on the front page.

Thanks!

Re: [ross] Featured rental listings

By _kate_ - April 2, 2009

Thanks Ross. I'll be able to do it, just need to know what to write to get it to sort by last updated time.

Thanks!

Re: [_kate_] Featured rental listings

By ross - April 2, 2009

Hi Kate

When you are generating the code for the featured listing viewer, make sure you check off the Advanced setting for Record Sorting. In the text field put "updatedDate DESC" and that should be it. In the viewer code, you'll see this up at the top:

'orderBy' => 'updatedDate',

Let me know if this gets things going. Thanks!
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/

Re: [ross] Featured rental listings

By _kate_ - April 5, 2009

Almost there :)

Got it working and displaying the featured listing, but it doesn't change if I specify another listing as the featured after any others I have selected. I assume the problem is the header as I wasn't sure what to put there to get only featured ones to display >>

<?php
require_once "/mysite/viewer_functions.php";

list($salesRecords, $salesMetaData) = getRecords(array(
'tableName' => 'sales',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
'where' => ' featured = "1" ',
'orderBy' => 'updatedDate',

));
$salesRecord = @$salesRecords[0]; // get first record

?>

Re: [_kate_] Featured rental listings

By ross - April 6, 2009

Hi Kate.

A couple things I can suggest here. First, remove this line:

'where' => whereRecordNumberInUrl(1),

Second, try changing:

'orderBy' => 'updatedDate',

to:

'orderBy' => 'updatedDate ASC',

or

'orderBy' => 'updatedDate DESC',

Let me know if this helps :).
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/

Re: [ross] Featured rental listings

By _kate_ - April 26, 2009

Woohoo! When I got rid of the where, and used 'orderBy' => 'updatedDate DESC' it worked like a charm.

Thanks Ross!