View all link

2 posts by 2 authors in: Forums > CMS Builder
Last Post: June 8, 2010   (RSS)

Re: [dccreatives] View all link

By Jason - June 8, 2010

Hi,

What you want to be able to do is to change the perPage option in the getRecords function.
For example, you probably have something that looks like this:
// load records
list($listingsRecords, $listingsMetaData) = getRecords(array(
'tableName' => 'listings',
'perPage' => '12',
));


First, you need to set up your View All link like this:
<a href="YOURPAGE.php?view=all"> View All </a>

Next, you can change you getRecords code like this:
if(@$_REQUEST['view']=="all"){
$view="";
}
else{
$view=12;
}
// load records
list($listingsRecords, $listingsMetaData) = getRecords(array(
'tableName' => 'listings',
'perPage' => mysql_escape($view),
));


This way, if they click on the link, all of the records will be displayed on one page, otherwise, it will default to displaying the first 12.

Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/