Page Number Plugin

   18 May 2004, terribly early in the morning

I’ve written a plugin for textpattern that will display the current page of you are on when viewing an articles list page. Someone on the Textpattern forum asked for such a thing. Hopefully this is what she wanted.


Update May 18th: The plugin now can be used to find the current page, and the total number of pages. There is also a tag that will generate a navigation widget that looks something like “ << Page 4 of 7 >> “.

Update May 19th: The plugin now lets you specify what text to use for the right and left navigation, and is enclosed in span so you can style the navigation element with css.

Update Sept 2nd 2005: The un-linked page number in the list generated by rsx_page_number_list is now wrapped in a span tag with a class of unlinked.

Update Oct 20th 2007: Jean Rajotte has updated the plugin; more details can be found on his web site.



  1. thanks again, I responded at the forum again – there are a few problems.

    By the way, He is a She!

  2. Thanks for the page number plugin. It’s very useful.


  3. I’ve been using rsx_page_number_list, from v3.0 of your plugin. I discovered that it doesn’t work correctly on a category list, so I made a slight mod to fix this. The only thing I know about PHP is that it looks sort of like Perl, so I don’t know how robust my fix will be. Anyway, I thought you’d like to know. Thanks for a nice plugin.

  4. Well you can email me your changes if you like and I can add them to the plugin.

  5. Hi, I have one question. Is there any possibility to add some css class to rsx_page_number_list to unlinked number? I’d like to style number of list of actual page. I think you understand what I mean. Thx. Sorry for my english :-)

    And thx for the plugin. It’s great. I use it on my page

  6. I can change the plugin so that the number is in a span or something like that, but you should be able to style it using css selectors.

  7. Well, I’ll appreciate that. Of course I’m able to style it if the unlinked number will be closed in a span

    Thank you very much. I’ll be waiting for new version of your plugin.

    I rewrite more than 7 plugins to fit my site but this time I don’t know how.

  8. THX for your quick job.

  9. Hi, i use your plugin on my page Textpattern v ?etin? and how can make: newer 1 2 3 4 older have it.

  10. I’m not entirely sure what you want to do? I’m guessing you want to use the page number tag I made, plus the built in older/newer tags.

  11. page_number_nav doesn’t work in 4.0.4

    tag_error -> Warning: array_keys() [function.array-keys]: The first argument should be an array on line 581

  12. Hi,

    I have txp 4.0.4, and the following code:

    <txp:if_section name=“testimonials”>
    <txp:article_custom allowoverride=“0” limit=“1” listform=“bodyonly” pgonly=“0” section=“testimonials” status=“5” />
    <txp:article listform=“titlebody” limit=“1” />
    <txp:rsx_page_number_list />
    <rsx_page_number_nav />

    rsx_page_number_list shows the list as expected, but the link points to index.php?pg=2. I’ve tried article_custom, but then it won’t even show the list.

    rsx_page_number_nav doesn’t show up at all.

    Am I doing something wrong? Or does the plugin not work for 4.0.4?


  13. you are missing the txp infront of rsx_page_number_nav, it should be txp:rsx_page_number_nav. And as you have discovered, the plugin doesn’t play nice with sections and categories. I’m pretty sure this is an old bug I never got around to fixing, but I can look into it.

  14. Thanks. I got the page_number_nav displaying, but I get a bunch of errors…

  15. It’s a very old plugin. A lot has changed with Textpattern since I wrote it. To put things in context, when I wrote that plugin, Textpattern was at version 1.17g, and it would be well over a year before the first official release was announced.

  16. Hi ramanan,

    I was very lucky to have found this plugin, as it’s exactly what I’ve been looking for. So thank you for writing and releasing it!
    But several times I read that it doesn’t work on txp 4.0.4. In April you announced in the forum, that you were working on an update. Have you finished it in the meantime? If it is the linked download: there is only a page displaying < ? php ? > when you click the link (FF2).
    I think some people are desparately missing it.
    Hope you can bring us good news.


  17. The plugin should work in 4.0.4. I think the only bug is that it doesn’t page through categories and sections the way people would expect it too. You copy and paste all that code into the plugin install form to isntall a plugin. I haven’t had a change to fix it yet. Well, I’m sure I’ve had chances, I just decided to do other things. There isn’t a newer version of this done by anyone else?

  18. Hi ramanan,
    I’ve looked at my page’s source code and found there exactly the same code that I’ve put into my page template, no parsing. No errors in production status=testing. Yes, the plugin is activated. Could you please help me? I’d appreciate that very much! If you need further information, mailing seems to be more convenient.

    No, there is no newer version done by somebody else. The only … hmn … “alternative”, at least concerning some aspects of it’s function and the appearance, jk_image works only in clean URL mode and seems just to change the image, not the page, which both doesn’t apply for my site.


  19. So what exactly is the problem?

  20. Hi Ramanan,

    Thanks for a great plugin! Just wondering if there is a simple way of reversing the page numbering so that it remains relatively constant (oldest page of articles is page 1).

    If you have other suggestions to achieve the same end, it would also be much appreciated.


Don't be shy, you can comment too!

Some things to keep in mind: You can style comments using Textile. In particular, *text* will get turned into text and _text_ will get turned into text. You can post a link using the command "linktext":link, so something like "google": will get turned in to google. I may erase off-topic comments, or edit poorly formatted comments; I do this very rarely.