Double Up on Data on the same page

3 posts by 2 authors in: Forums > CMS Builder
Last Post: April 20, 2011   (RSS)

Re: [kcmedia] Double Up on Data on the same page

By Kenny - April 20, 2011

Craig,

You will need to call up this table more than once. Right now you have:

// load records
list($newsRecords, $newsMetaData) = getRecords(array(
'tableName' => 'news',
'limit' => '5',
));


Go ahead and create another one, but lets give it a new name:

// load records
list($newsSideRecords, $newsSideMetaData) = getRecords(array(
'tableName' => 'news',
'limit' => '20',
));


Then you can modify your foreach statement to bring up the news items you want on the side.


<?php foreach ($newsSideRecords as $record): ?>




Also, if you don't want to show the first 5 articles in this list since you will have them on the left hand side, then add an offset like this:

// load records
list($newsSideRecords, $newsSideMetaData) = getRecords(array(
'tableName' => 'news',
'limit' => '20',
'offset' => 5,
));



Offset to 5 to start with the 6th article since the counting will be done like this: 0, 1, 2, 3, 4 = left side and 5, 6, 7, 8, 9..... = right side


Let us know if you have any other questions about this.

Kenny

Re: [Kenny] Double Up on Data on the same page

By KCMedia - April 20, 2011

Hi Kenny

thank you very much worked great.
Thanks



Craig

KC Media Solutions

www.kcmedia.biz