I believe comments is setup to show 10 comments before beginning pagination, so you could edit the core file PageComment.php, the static variable $comments_per_page.
For creating pagination for other dataobjects you can do the following.
ReviewArticle.php
<?php
/*
* Custom Class for Review home page
*
*/
class ReviewHolder extends Page{
public static $db = array();
public static $has_one = array();
public static $has_many = array(
'Reviews' => 'Review'
);
public static $default_child = "Review";
/**
* Returns dataobject set containing reviews
* @RETURN DataObjectSet
**/
function getAllReviews() {
if(!isset($_GET['start']) || !is_numeric($_GET['start']) || (int)$_GET['start'] < 1){
$SQL_start = 0;
$get = "Review";
$where = NULL;
$sort = NULL;
$join = NULL;
$limit = "{$SQL_start}, 2";
$reviews = DataObject::get($get, $where, $sort, $join, $limit);
return $reviews;
}else{
$SQL_start = (int)$_GET['start'];;
$get = "Review";
$where = NULL;
$sort = NULL;
$join = NULL;
$limit = "{$SQL_start}, 2";
$reviews = DataObject::get($get, $where, $sort, $join, $limit);
return $reviews;
}
}
}
class ReviewHolder_Controller extends Page_Controller{
}
?>
in the $limit field change the the number 2 to your desired number of objects to show.
and on your template you can do this
ReviewHolder.php
<% if getAllReviews %>
<% control getAllReviews %>
<div class="review">
<a href="reviews/$URLSegment">$GameCover.setWidth(160)</a>
<h1><a href="reviews/$URLSegment">$Title.XML</a></h1>
$Content.LimitCharacters(250)...<a href="reviews/$URLSegment">Read More</a>
</div>
<% end_control %>
<% if getAllReviews.MoreThanOnePage %>
<p id="pagination">
<% if getAllReviews.PrevLink %>
<a class="previous" href="$getAllReviews.PrevLink">Prev</a> |
<% end_if %>
<% control getAllReviews.Pages %>
<% if CurrentBool %>
$PageNum
<% else %>
<a class="pageNum" href="$Link" title="Go to page $PageNum">$PageNum</a>
<% end_if %>
<% end_control %>
<% if getAllReviews.NextLink %>
|<a class="next" href="$getAllReviews.NextLink">Next</a>
<% end_if %>
</p>
<% end_if %>
<% end_if %>
Hope that helps