Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

[SOLVED] Max of links in SmartyPaginate ?
Goto page 1, 2  Next
 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Add-ons
View previous topic :: View next topic  
Author Message
__fabrice
Smarty Rookie


Joined: 13 Jan 2005
Posts: 18

PostPosted: Thu Feb 24, 2005 9:08 am    Post subject: [SOLVED] Max of links in SmartyPaginate ? Reply with quote

Hi everbody,
I have a question about 'Smarty Paginate'. Can I set a 'max' value' for links to show ?
Example
Code:
$maxvalues=3;
prev [0-10] [11-20] [21-30] ... ... next
$maxvalues=5;
prev [0-10] [11-20] [21-30] [31-40] [41-50]... ... next

I have a lot of links and my htlm page is over Sad

Thanks
Fabrice


Last edited by __fabrice on Tue May 24, 2005 1:58 pm; edited 1 time in total
Back to top
View user's profile Send private message Yahoo Messenger
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Thu Feb 24, 2005 2:42 pm    Post subject: Reply with quote

This functionality is not there yet... but in progress.
Back to top
View user's profile Send private message Visit poster's website
__fabrice
Smarty Rookie


Joined: 13 Jan 2005
Posts: 18

PostPosted: Thu Feb 24, 2005 2:49 pm    Post subject: Reply with quote

ok Crying or Very sad
And when can U add this function,please ?

Regards,
Fabrice
Back to top
View user's profile Send private message Yahoo Messenger
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Thu Feb 24, 2005 8:46 pm    Post subject: Reply with quote

As soon as you send me the patch Smile I have no date set for having it done.
Back to top
View user's profile Send private message Visit poster's website
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Thu Feb 24, 2005 10:03 pm    Post subject: Reply with quote

OK surprise, I have been working on this since yesterday, I have something working committed to CVS. You can do this:

{paginate_middle page_limit="5"}

That will limit the display to five groups of pages. There are also two other new template functions:

{paginate_first}
{paginate_last}

You can probably figure those out.
Back to top
View user's profile Send private message Visit poster's website
__fabrice
Smarty Rookie


Joined: 13 Jan 2005
Posts: 18

PostPosted: Thu Feb 24, 2005 10:20 pm    Post subject: Reply with quote

Laughing it's great Very Happy

I'm gonna to test this tomorrow and i 'call you back' Smile

Thanks.
Fabrice
Back to top
View user's profile Send private message Yahoo Messenger
__fabrice
Smarty Rookie


Joined: 13 Jan 2005
Posts: 18

PostPosted: Fri Feb 25, 2005 4:08 pm    Post subject: Reply with quote

Hi,

Ok, but... how can I do to do this ? , I don't understand...
I never work with CVS.

Thanks a lot.
Fabrice
Back to top
View user's profile Send private message Yahoo Messenger
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Fri Feb 25, 2005 4:14 pm    Post subject: Reply with quote

I put up a snapshot:

http://www.phpinsider.com/php/code/SmartyPaginate/SmartyPaginate-CVS-20050225.tar.gz
Back to top
View user's profile Send private message Visit poster's website
__fabrice
Smarty Rookie


Joined: 13 Jan 2005
Posts: 18

PostPosted: Fri Feb 25, 2005 11:22 pm    Post subject: Reply with quote

Hi,

I just test this,ok, it's fine Smile... but .... the "first" and "last" is in english, and my site is multi-langage Sad.
I also notice a bug (i think Smile), example :

1°)first - [1-50][51-100][101-150][151-200][201-250] - last => [1-50] is set

2°)first - [1-50][51-100][101-150][151-200][201-250] - last => [51-100] is set

3°)first - [1-50][51-100][101-150][151-200][201-250] - last => [101-150] is set

4°) if I click on [151-200], look :
first - [26-75][76-125][126-175][176-225][226-275] - last => ??? nothing is set

Thanks
Fab
Back to top
View user's profile Send private message Yahoo Messenger
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Sat Feb 26, 2005 3:38 pm    Post subject: Reply with quote

You can change the text two ways:

SmartyPaginate::setFirstText('first');

Or

{paginate_first text="first"}

I don't seem to have that problem with the pagination, I'll look some more.
Back to top
View user's profile Send private message Visit poster's website
gman
Smarty Rookie


Joined: 27 Feb 2005
Posts: 5

PostPosted: Sun Feb 27, 2005 5:27 am    Post subject: Reply with quote

Hi,

The page_limit function is a great idea. I just tried it and when using format=page with page_limit, the pagination incorrectly starts at zero.

eg:
{paginate_prev} {paginate_first} {paginate_middle format="page" page_limit="5"} {paginate_last} {paginate_next}

produces:
prev first [0][1][2][3][4] last next

Shouldn't it be:
prev first [1][2][3][4][5] last next

???
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Mon Feb 28, 2005 4:55 pm    Post subject: Reply with quote

Problem with [0] page is fixed in CVS. Thanks!
Back to top
View user's profile Send private message Visit poster's website
__fabrice
Smarty Rookie


Joined: 13 Jan 2005
Posts: 18

PostPosted: Mon Feb 28, 2005 5:26 pm    Post subject: Reply with quote

and the other problem that i show you ?

Fabrice
Back to top
View user's profile Send private message Yahoo Messenger
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Mon Feb 28, 2005 6:27 pm    Post subject: Reply with quote

__fabrice wrote:
and the other problem that i show you ?

Fabrice


Found it, and fixed in CVS. Please test.

http://www.phpinsider.com/php/code/SmartyPaginate/SmartyPaginate-CVS-20050228.tar.gz
Back to top
View user's profile Send private message Visit poster's website
__fabrice
Smarty Rookie


Joined: 13 Jan 2005
Posts: 18

PostPosted: Mon Feb 28, 2005 6:56 pm    Post subject: Reply with quote

It's ok..., perfect Very Happy
Thanks.

Fabrice
Back to top
View user's profile Send private message Yahoo Messenger
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Add-ons All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP