Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2004-05-17 02:41:14

ramanan
Plugin Author
From: Toronto
Registered: 2004-03-12
Posts: 323
Website

rsx_page_number

Someone asked for a plugin to display the page number of an article list page. This plugin will do that. At least I am fairly certain it does.

rsx_page_number.txt

Last edited by ramanan (2004-05-17 02:42:51)

Offline

#2 2004-05-17 03:02:59

fri
Member
From: Denmark
Registered: 2004-04-30
Posts: 34
Website

Re: rsx_page_number

ramanam,

you certainly ARE fast.
thankyou – very much

Offline

#3 2004-05-17 04:06:44

fri
Member
From: Denmark
Registered: 2004-04-30
Posts: 34
Website

Re: rsx_page_number

ramanam,

sorry but I get this:
Notice: Undefined variable: offset in C:\WINDOWS\TEMP\plu42E0.TMP on line 14
on top of my page. I’m using txp on my localhost.

Despite this, the pagenumber displays allright, but I need to extract the total number of pages also – to compare – otherwise one does not where one is in in the process of navigating a section…
You know, a deployed output “pages 1 2 3 4” (linked numbers)
or “<< page 2 (…of 5) >>”
That way you size the heystack, when you, as a user of a big site, are skimming it for needles…

I’m posting this in the how to forum as well, in case you miss it here..
I appreciate your effort.

Offline

#4 2004-05-17 18:55:46

ramanan
Plugin Author
From: Toronto
Registered: 2004-03-12
Posts: 323
Website

Re: rsx_page_number

That is strange. I will muck around with the plugin some more. Also, I’ll try modifying the plugin to display both the way you suggest.

Offline

#5 2004-05-18 05:59:41

mamash
Member
From: Prague
Registered: 2004-02-21
Posts: 127
Website

Re: rsx_page_number

Ramanan, you’d better turn on error_reporting(E_ALL) for developing. It will make you write 100% correct code, while leaving those of us who run with this setting by default with error-free pages… ;)


Who’s gonna textdrive you home tonight?

Offline

#6 2004-05-18 06:30:59

ramanan
Plugin Author
From: Toronto
Registered: 2004-03-12
Posts: 323
Website

Re: rsx_page_number

Oh thanks. Good to know. Everything I code in PHP is me winging-it. Thanks for that tip. The offset error shouldn’t show up anymore. I’ll post all my changes in a bit.

Last edited by ramanan (2004-05-18 07:12:05)

Offline

#7 2004-05-18 08:27:29

ramanan
Plugin Author
From: Toronto
Registered: 2004-03-12
Posts: 323
Website

Re: rsx_page_number

I’ve update the plugin. The error with unset variables is gone, and I’ve added 2 more tags, one that returns the last page number, and one that returns a navigation element that looks like this :

Offline

#8 2004-05-19 20:37:04

ramanan
Plugin Author
From: Toronto
Registered: 2004-03-12
Posts: 323
Website

Re: rsx_page_number

I’ve updated the plugin once more. You can now supply the text to use for the left and right navigation (it defaults to << and >>). Also, everything is wrapped in span’s you can style with textpattern. I’m using it at my site for the time being if you want to see it in action. The next time I update this i’ll add the other form of navigation suggested (Page 1 2 3 4 5…)

Offline

#9 2004-05-21 15:08:13

fri
Member
From: Denmark
Registered: 2004-04-30
Posts: 34
Website

Re: rsx_page_number

Good work, ramanam.

I’m looking forward to the new variation(1, 2, 3, 4 …)

What would be VERY nice, is a navigation bar, that toggeled linked pages on article-lists, and linked articles when individual articles are on.
(The built in if-tags don’t seem to work when put in top of the page – only after the article-tag.)

Offline

#10 2004-05-21 17:12:37

ramanan
Plugin Author
From: Toronto
Registered: 2004-03-12
Posts: 323
Website

Re: rsx_page_number

How did you want the (1,2,3,4 … ) thing to look. I wrote one, but it seems like it would be ugly, or unwieldly. You want a complete list of all the page nubmers, or just the next few?

Offline

#11 2004-05-21 20:17:19

fri
Member
From: Denmark
Registered: 2004-04-30
Posts: 34
Website

Re: rsx_page_number

Like the Google results, all numbers linked to the actual page, exept for the actual page:
1 2 3 4 5 6 7 8 … 28
if the amount of pages exeed some set start-limit, i.e: 7 above the actual page.
then increasing :
1 2 3 4 5 6 7 8 9 10 11 12 … 28
still with 7 beeing a user-defined amount of pages above the actual page.

I plan to have archives for the previous months, so I don’t think it would be that many pages at one time, but maby that isn’t possible , and I would end up with 1000 pages, is that6 what you mean?

because then one should be able to define a number of pages below the actual page too.

1 … 11 12 13 14 15 16 17 … 1000 (!!! ;-)

You are great doing this, and I just keep asking for it without really knowing if it is monstrously complicated to code! I feel like at least bying you coffee while you are doing it!

Last edited by fri (2004-05-21 20:45:24)

Offline

#12 2004-05-27 18:44:14

Sketch
Archived Plugin Author
From: Washington, D.C.
Registered: 2004-05-20
Posts: 23
Website

Re: rsx_page_number

You should create the list with CSS classes so it can be styled anyway one likes it. In addition, you should create a separator attribute in the tag that determines how page numbers will be separated. I have a fixation for &raquo; but many people do not….

Last edited by Sketch (2004-05-27 18:44:43)


Aaron Brazell
United States Navy
chmod a+x /bin/laden – Give everyone permission to execute /bin/laden

Offline

Board footer

Powered by FluxBB