I'm working on a homepage which will have multiple pages list on it, I need each one to go to its next page individually. So far I've managed to patch this together with the help of a few developers on this site (Remo, Dutchwave, matogertel and poorleno thanks guys)
<?phpdefined('C5_EXECUTE') or die(_("Access Denied."));$textHelper= Loader::helper("text");$imgHelper= Loader::helper('image');// now that we're in the specialized content file for this block type, // we'll include this block type's class, and pass the block to it, and get// the content$reservedParams=array('page=','query=','search_paths[]=','submit=','search_paths%5B%5D=','all');$pages=$cArray;$pagination= Loader::helper('pagination');//pagination $pageSize=4;$page=intval($_REQUEST['page']);#print $page;global$c;
<?phpdefined('C5_EXECUTE') or die(_("Access Denied."));$textHelper= Loader::helper("text");$imgHelper= Loader::helper('image');// now that we're in the specialized content file for this block type, // we'll include this block type's class, and pass the block to it, and get// the content$reservedParams=array('page=','query=','search_paths[]=','submit=','search_paths%5B%5D=','all');$pages=$cArray;$pagination= Loader::helper('pagination');//pagination $pageSize=4;$page=intval($_REQUEST['page']);#print $page;global$c;$cID=$c->getCollectionId();$cPath=$c->getCollectionPath();//clean and build query string from current URI $url=$_SERVER['REQUEST_URI'];if(!strstr($url,'?'))$url.='?';else{//strip non reserved params from query string, leave the unique params$qStr=substr($url,strpos($url,'?')+1);$qStrParts=explode('&',$qStr);$nonReservedQStrParts=array();foreach($qStrPartsas$qStrPart){$reserved=0;foreach($reservedParamsas$reservedParam){if(strstr($qStrPart,$reservedParam)){$reserved=1;break;}}if($reserved)continue;$nonReservedQStrParts[]=$qStrPart;}$php_self=(!strstr($_SERVER['PHP_SELF'],'?'))?$_SERVER['PHP_SELF'].'?':$_SERVER['PHP_SELF'];$url=$php_self.join('&',$nonReservedQStrParts);}$pageBase=$url;$queryString='&page=%pageNum%';$pagination->init($page,count($pages),$pageBase.$queryString,$pageSize);$limitedResults=$pagination->limitResultsToPage($pages);//this wasn't needed#$this->set('paginator', $pagination); $cArray=$limitedResults;if(count($cArray)>0){?>
<div class="ccm-page-list">
<?phpfor($i=0;$i<count($cArray);$i++){$cobj=$cArray[$i];$title=$cobj->getCollectionName();$thumb=$cobj->getCollectionAttributeValue('thumbnail');if($thumb)$thumb=$imgHelper->getThumbnail($thumb,100,100);?>
<h3><a href="<?phpecho$nh->getLinkToCollection($cobj)?>"><?phpecho$title?></a></h3>
<div class="ccm-page-list-description">
<?phpif($thumb):?>
<div class="ccm-page-list-thumbnail">
<img src="<?phpecho$thumb->src?>" alt="<?phpecho$title?>"/></div>
<?phpendif;?><?phpif(!$controller->truncateSummaries){echo$cobj->getCollectionDescription();}else{echo$textHelper->shortText($cobj->getCollectionDescription(),$controller->truncateChars);}?></div>
<?php}if(!$previewMode&&$controller->rss){$btID=$b->getBlockTypeID();$bt= BlockType::getByID($btID);$uh= Loader::helper('concrete/urls');$rssUrl=$controller->getRssUrl($b);?>
<div class="rssIcon">
<a href="<?phpecho$rssUrl?>" target="_blank"><img src="<?phpecho$uh->getBlockTypeAssetsURL($bt)?>/rss.png" width="14" height="14" /></a></div>
<link href="<?phpecho$rssUrl?>" rel="alternate" type="application/rss+xml" title="<?phpecho$controller->rssTitle?>" />
<?php}?>
</div>
<?phpif(count($cArray)>0){if($pagination&&strlen($pagination->getPages())>0){?>
<div style="width: 25%; margin-top:10px; float:left;"><?phpecho$pagination->getPrevious("Previous")?></div>
<div style="width: 50%; margin-top:10px; float:left; text-align: center">Page <?phpecho$pagination->getPages()?></div>
<div style="width: 25%; margin-top:10px; float:left; text-align: right"><?phpecho$pagination->getNext("Next")?></div>
<?php}?><?php}}?>
I duplicated this script four times in the custom folder of the page list block, in the hope that it would just change the column it was in, but all the columns changed to their second page.
I've managed to work this out. I've just defined the 'page' element as something different in each of the custom templates (see attached code)
<?phpdefined('C5_EXECUTE') or die(_("Access Denied."));$textHelper= Loader::helper("text");$imgHelper= Loader::helper('image');// now that we're in the specialized content file for this block type, // we'll include this block type's class, and pass the block to it, and get// the content$reservedParams=array('page_fund=','query=','search_paths[]=','submit=','search_paths%5B%5D=','all');$pages=$cArray;$pagination= Loader::helper('pagination');//pagination $pageSize=4;$page=intval($_REQUEST['page_fund']);#print $page;global$c;
Hope this can help others out there.