Featured Listing Requirement

12 posts by 3 authors in: Forums > CMS Builder
Last Post: June 25, 2009   (RSS)

By ross - June 23, 2009

Hi there.

Thanks for posting your template :). What we need is a second list of items from your "serviced_accommodation" but this one is one for featured listings.

To start off with, you'll need to add a new viewer. That will need to go up at the top of your page and look something like this:

// load featured listings
list($serviced_accommodationRecordsFeatured, $serviced_accommodationMetaDataFeatured) = getRecords(array(
'tableName' => 'serviced_accommodation',
'orderBy' => 'RAND()',
'where' => 'featured = 1',
));


It's pretty much the same as the other one you already have there but see how I added in the where featured = 1.

The only thing is that I don't know what your featured field is called. You'll need to make sure you change that if yours is different.

Now, to display the items from that list, you use this foreach loop:

<?php foreach ($serviced_accommodationRecordsFeatured as $record): ?>
a bunch of code goes here
<?php endforeach; ?>


And that's all there is to it. Give this a shot and let me know how you make out :).
-----------------------------------------------------------
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/