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

Roy Schestowitz r at schestowitz.com
Wed Nov 8 18:06:27 GMT 2006

___/ On Wed 08 Nov 2006 14:43:54 GMT, [ Computer Guru ] wrote : \___

> 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.

The simplicity is splendid, but I am reluctant to use the pagination  
function as often as one should. It begs for the inclusion some links  
that ease navigation (e.g. adding section titles or "adding back to  
page X" or "next page" hyperlinks). How often have you stumbled upon  
an article which you failed to see (at least based on a first glimpse)  
was fragmented into finer segments? A TOC is important as well. Only  
then can you discover the pertinent details (e.g. screenshots) that  
interest you the most. Pageloads and scrolling are miles away in terms  
of response/reaction time.

> 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?

Excellent idea! Hadn't even read it before I wrote the previous  
paragraph (long post). *smile*

> 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.

Employ a popup menu/sequence that generates this, just like links in  
ol' skool WordPress (before TinyMCE).

> 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?

Haven't touched WordPress code for a long time, but previous followups  
suggest that you'll get help and support.

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

Simple JavaScript prompts don't count as "Ajax", which by the way,  
WordPress hasn't much of. The term Ajax has been contaminated since  
Jesse first coined it. Same with Web 2.0.

Best wishes,


Roy S. Schestowitz, Ph.D. Candidate in Medical Biophysics
http://Schestowitz.com  |  GNU/Linux  |     PGP-Key: 0x74572E8E
http://othellomaster.com - GPL'd 3-D Othello
http://iuron.com - proposing a non-profit search engine

More information about the wp-hackers mailing list