Multiple record listing

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

By Oakweb - May 16, 2010

Hi

I have just purchased my first copy of CMS Builder having used Realty Manager to build Property sites before. I have a couple of questions. I have done a news page which lists news items down the page with a limit of 10 per page and that is fine. I also have a panel on each page which will list the latest 5 news headlines. This is also on the news page as it is integral to the site. How do I set a separate limit of 5 records in the headlines panel whilst retaining 10 news items per page in the main news listing.

Also are there any instructions anywhere for getting featured listings working as I would like to dot a few featured properties around the site.

Hope this makes sense.
[/#000000]

Re: [Oakweb] Multiple record listing

By ross - May 17, 2010

Hi Oakweb

Thanks for posting!

I wanted to continue on Jerry's post. I think what you'll want to do with the news articles in two different lists is use two different viewers.

One could look like this:

<?php
// load headlines for side of page
list($newsRecordSide) = getRecords(array(
'tableName' => 'news',
'limit' => '5',
));
?>


and the other one could look like this:

<?php

// load headlines for middle of page
list($newsRecordsMiddle, $newsMetaDataMiddle) = getRecords(array(
'tableName' => 'news',
'limit' => '10',
));
?>


That will give you two different lists from the same table. You'll notice that in the first block I took out the meta data variable. This is usually only used if you are going to have next and previous links. Because the first block is only for the side list of articles, you won't need next and previous links.

Also, one thing I always recommend is adding comment tags above each viewer just so you can quickly see what it's trying to do instead of reading all the code every time.

Let me know if that helps. We can also have a look at your second questions if you still need more details.

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] Multiple record listing

By Oakweb - May 18, 2010

Many thanks for your help - all working well