|
From: Norman Y. <ya...@ya...> - 2012-03-16 09:16:28
|
Attached is a patch that enables pagination in static-rendering mode, pagination being the rendering of index pages which are longer than num_entries by writing them out to multiple pages, combined with the production of navigation strings which the user can include in the templates for those pages. Since: -- doing this as a plugin seemed somewhere between painful and impossible, and -- I think this really should be core functionality anyway, I went ahead and implemented the whole thing in the core. It should work for dynamic rendering, too (or whatever one calls the opposite of static rendering), but I haven't tested that mode. It is meant to supersede the present "paginate" plugin, but the latter should still work (again, untested). It uses all the same config variables, except for "paginate_count_from", which I thought was far too much in the bikeshedding direction to be worth saving. The variable "paginate_linkstyle" accepts, besides the old settings (0 or 1), the more descriptive settings "1 of 4" (same as style 1) or "1234" (same as style 0). For static rendering, instead of the page number being sent in the HTML query, as in http://example.com/blog/index.html?page=2 it has to be part of the filename, as in http://example.com/blog/index_page2.html which is now this change does it. I haven't yet fixed up the documentation to reflect the changes. (As for why I think this should be core functionality, I can't imagine anyone not wanting it, at least for normal weblog use.) -- Norman Yarvin http://yarchive.net/blog |