Double Up on Data on the same page
3 posts by 2 authors in: Forums > CMS Builder
Last Post: April 20, 2011 (RSS)
By KCMedia - April 19, 2011
Hi
I have this page www.marlingfishingaustralia.com.au/news.php and on it i will have 5 of the most current news items on it down the left hand side of the page buton the right i want a list of the last 20 news items listed with just their title and date on it how can i go about this.
I have the left hand side working ok but not the right.
then when they click on the new item on the right it will go to a detail page and show that new item.
i have attached the news page
I have this page www.marlingfishingaustralia.com.au/news.php and on it i will have 5 of the most current news items on it down the left hand side of the page buton the right i want a list of the last 20 news items listed with just their title and date on it how can i go about this.
I have the left hand side working ok but not the right.
then when they click on the new item on the right it will go to a detail page and show that new item.
i have attached the news page
Thanks
Craig
KC Media Solutions
www.kcmedia.biz
Craig
KC Media Solutions
www.kcmedia.biz
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
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.
thank you very much worked great.
Thanks
Craig
KC Media Solutions
www.kcmedia.biz
Craig
KC Media Solutions
www.kcmedia.biz