Jump to content

Faire une pagination type << 1 2 3 4 >> [ besoin d'aide ]


Recommended Posts

Bonjour,

je tourne sur une presta 97 et cherche à faire une pagination dans ce style :

<< 1 2 3 4 >>

voilà mon code actuel de test qui donne un truc pas super :

{if isset($p) AND $p}

   {if $p != 1}
{l s='Previous page'}    -
   {/if}
   {l s='Page'} {$p} / {$pages_nb}
   {if $pages_nb > 1 AND $p != $pages_nb}
       - {l s='Next page'}
   {/if}

{/if}



Merci d'avance de toute aide même petite et à bientôt...

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

Salut, je ne sais pas si ça peux t'aider voila ce que j'ai fait dans une 1RC4.

ça affiche << 1...8 9 10...51 >>

bon c'est confus c'est sûr :)

Bonne chance

{if isset($p) AND $p}
<!-- Pagination -->

{if $start!=$stop}

   {if $p != 1}

   {else}

   {/if}
   {if $start>3}
1
...
   {/if}
   {section name=pagination start=$start loop=$stop+1 step=1}
       {if $p == $smarty.section.pagination.index}
{$p}
       {else}
{$smarty.section.pagination.index}
       {/if}
   {/section}
   {if $pages_nb>$stop+2}
...
{$pages_nb}
   {/if}
   {if $pages_nb > 1 AND $p != $pages_nb}

   {else}

   {/if}

{/if}

<!-- /Pagination -->
{/if}

Link to comment
Share on other sites

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...