[wp-hackers] Revamping the <!--nextpage--> Pagination Function

Computer Guru computerguru at neosmart.net
Wed Nov 8 14:43:54 GMT 2006


Hi guys,

For those of us that use WP more as a CMS than as a blogging platform and
tend to have longer articles (read: reviews) up on WP, I've constantly been
less than happy with the pagination process.

WP's current pagination system is good for breaking up long articles into
smaller bits, but not for breaking up based on logical portions of articles.
I mean, it's not for use with a Table of Contents and post-page titles.

How hard would it be to completely redo the pagination process? I just
finished my exams and have *some* spare time and am willing to work on it.
The only problem is, I don't see how a revamped <!--nextpage--> function
would work.

The problem is that it is an immediate call without pre-planning. WP finds
the occurrences and explode()s based on them.

Would it work to add a custom field called "page headers" and have it act as
a CSV field with the names of each page?

So like:

page-headers:
Introduction,Gaming,Hardware,Cost,Benchmarks,Overclocking,Final Thoughts

and every time the explode function returns a value instead of assigning it
the text "next page" it will assign it an index of page-headers? 

Then provided that Page 1 is to be taken as an intro, it can spit out the
ToC at the bottom - or else into a scrolling i-frame at the top-right corner
of the first page.


This "new" method would cover everything mostly, but it's very clunky, so
I'm looking for suggestions. It makes too many assumptions, and it's not
intuitive. Having users enter the names of pages as CSVs isn't nice, and
having the ToC only on the front page most certainly isn't either.

The problem is that solving these can get really ugly really fast. For
instance, replacing <!--ToC--> with the table of contents would work, but
how long until new problems come up?

Anyway, just wondering if anyone would be interested in
a) using such a system - and how many
b) helping with the code a bit?


Most importantly, suggestions for making it more intuitive without adding
graphical clutter (Ajax ToC creation section?!) and stuff.

Computer Guru
NeoSmart Technologies
http://neosmart.net/blog/





More information about the wp-hackers mailing list