Summary:
good pagination << < 1 2 3 4 5 > >>
Detailed Description:
(sorry for my bad english...)
i find this question on forum but there is no answer(moderator bug my message
because this is a hack=))
QUESTION:
By default Products module uses the following scheme for pagination:
Code:
<< < Page 1 Of 5 > >>
I'd like it to be:
Code:
< Previous 1 2 3 4 5 6 7 Next >
Is it possible? And how can I do it?
---------------------------------------------------------------------------
may be this help
go to action.default.php
find this code (string 526 may be little more or less)
[code]
if( $page == 1 )
{
$smarty->assign('firstlink',$this->Lang('firstpage'));
$smarty->assign('prevlink',$this->Lang('prevpage'));
}
[/code]
........
go section with pages
[code]
else
{
$parms = $params;
$parms['page'] = $npages;
......
[/code]
put this code
[code]
$pages_array = array();
for($z=1;$z<=$npages;$z++)
{
$parms['page'] = $z;
$pages_array[$z] = $this->CreateLink($id,'default',$returnid, $z,$parms);
}
$smarty->assign('fucking_pages',$pages_array);
[/code]
and put this code in section
[code]
if( $page == $npages )....
[/code]
go to summaty tempate and write something like this
[code]
<div style="border: 1px solid red">
{$firstlink}
{$prevlink}
{foreach from=$fucking_pages key=page_key item=page}
{if $page_key == $curpage}
<span style="border: 1px solid red">{$page}</span>
{else}
{$page}
{/if}
{/foreach}
{$nextlink}
{$lastlink}
</div>
[/code]
in my project this work good..)