Hello, I am trying to use pagination with dataobjects, and it is not working properly.
The function to get Dataobjects looks like this:
function getLOTDs($pageLimit=5){
if(!isset($_GET['start']) || !is_numeric($_GET['start']) || (int)$_GET['start'] < 1) $_GET['start'] = 0;
$SQL_start = (int)$_GET['start'];
$getLOTDs = DataObject::get('LOTD',"","Created DESC","","");
$returnlotds = $getLOTDs->getRange($SQL_start, $pageLimit);
return $returnlotds;
}
the template to display them looks like this:
<% control getLOTDs %>
<li>
<a href="$LOTD">$LName</a>
</br>
<% if Top.canDelLOTD %>
<a href="LOTD/delLOTD/$ID">Brisanje</a>
<% end_if %>
<% if Top.canEditLOTD %>
<a href="$EditLOTDForm">Izmijeni</a>
<% end_if %>
</li>
<% end_control %>
<% include LOTDPagination %>
the LOTDPagination looks like this:
<% if getLOTDs.MoreThanOnePage %>
<div id="PageNumbers">
<p>
<% if getLOTDs.NotFirstPage %>
<a class="prev" href="$getLOTDs.PrevLink" title="View the previous page">Prev</a>
<% end_if %>
<span>
<% control getLOTDs.PaginationSummary(4) %>
<% if CurrentBool %>
$PageNum
<% else %>
<% if Link %>
<a href="$Link" title="View page number $PageNum">$PageNum</a>
<% else %>
…
<% end_if %>
<% end_if %>
<% end_control %>
</span>
<% if getLOTDs.NotLastPage %>
<a class="next" href="$getLOTDs.NextLink" title="View the next page">Next</a>
<% end_if %>
</p>
</div>
<% end_if %>
Can't seem to find an error, the output I get from this is:
Interni Carnet web
Brisanje Izmijeni
Monitor
Brisanje Izmijeni
YouTube
Brisanje Izmijeni
Index.hr
Brisanje Izmijeni
Net.hr
Brisanje Izmijeni
Default Admin
Last visit: 24 May 2011
Log Out
So it displays only the 5 links properly, but it doesn't display the available pages and pagination bar where it should. Can som1 plz help?