I've based my site search on tutorial4. I would like to extend this with a line at the top saying:
Results 1 - 10 of 25 for 'query'.
However, I can't seem to make it work correctly. I can get the pageStart, but this starts at 0 rather than 1. I tried adding the pageLength to the pageStart but I couldn't do calculations in a templates.
I've tried adding the data to the Page_Controller
function results($data, $form){
$data = array(
'Results' => $form->getResults(),
'Query' => $form->getSearchQuery(),
'Title' => 'Search Results',
'PageStart' => $form->getResults()->pageStart+1,
'PageEnd' => $form->getResults()->pageStart + $form->pageLength,
);
return $this->customise($data)->renderWith(array('Page_results', 'Page'));
}
but this didn't work as the pageStart didn't change from 0.
I've tried the following in the template:
Results <strong>$Results.pageStart - $Results.pageEnd</strong> of <strong>$Results.TotalItems</strong> for <strong>$Query</strong>
but this didn't work either.
Does anyone know of a way to make this work?