RSS
14 Aug 2009

Paging in Drupal

It's always interesting what a CMS does out of the box and what gets filled in with extra modules (i.e., things you add on to the core program).  Drupal does a lot of nice things in its core but in general doesn't do everything.  In fact there seems to be a healthy ongoing evaluation of what should be in core and what shouldn't.  There's been some shift since I started using Drupal in 2006 (for example a view stuff by archived date function is no longer in core) and there will be more in Drupal 7 I'm sure (there seems to be a push to include some stuff in 7 that has been maturing as a separate module).

Anyhow, while this system works well it does put the onus on the consumer (that's you, the one building the Drupal site) to pick what to use and sometime pick among modules with overlapping functions.  One of the things I wanted to do in comixtalk.com is split up some of the longer posts in separate pages.  Drupal doesn't do that in core.  Instead you have to look to additional modules for this function.

I've used Paging and despite some hiccups in getting a formally supported version for Drupal 6 (all seems resolved now) it works just fine.  The less than perfect parts of it: You have to add in manually the page break; you get funny URLs for the additional pages you created (actually Paging's current maintainer, Gurpartap Singh, has a workaround for this problem here); it shows Drupal's comments after every page in the post (not just the end page where most people would probably prefer).

There are other modules in this subject area: Clean Pagination is for creating SEO-friendly URLs; Minimax pager adds in a text box to jump to a specific page; and one I haven't used yet that seems to significantly overlap the paging module -- Pagination.  I think some people in Drupal push hard not to have essentially duplicative projects, but I have never seen an official rule prohibiting it and given the realities of an open source project significantly driven by individual passion for coding and individual needs for specific projects it's a given that people are going to do what they want to get what they need.  In cases where there appear to be two or more solutions to a problem though it seems like a really good approach is to include a comparison of them in each module's home page.  Something simple - this does that, that does this, they all do this.

UPDATE: Saw this thread on the pagination project where the creators of the Pagination and Paging modules argued over whether or not to collaborate and combine their projects.  Looks like as of now, they haven't...

User login