Archive for July, 2010

Has it really been a year?

Posted in new features on July 5th, 2010 by Mat – Be the first to comment

Yes. Yes it has. The last post here, and therefore the last update to Dinqi was in May ‘09. Oops.

Well, after what was probably the busiest and toughest year of my career I’ve now emigrated, and left the BBC. As a result I have a bit of spare time, and more importantly inclination to work on my pet project - so Dinqi is going to get some much needed love.

This morning I’ve added simple ‘next’ and ‘previous’ pagination to the main view events page, meaning you can finally go back and view beyond 20 events.

The pagination is available to both the HTML and RSS views and works for any set of data (e.g. just films, films and books, everything etc.).

There’s also a shortcut value of “all” for the “numofitems” value (and a corresponding button in the HTML view), in case anyone wants to do away with pagination completely. Thus if a user wanted to get an XML copy of all the event data they’ve put into Dinqi for example, just add “?numofitems=all” to the all entries RSS view.

A note about the URLs - this pagination is the first time I’ve used query strings to Dinqi. Up to now everything has been done via the directory structure (well, at least as far as the user sees - thank you .htaccess). However there’s a good reason for this:

I spent a while thinking about how I could convey what was being shown in an elegant way alongside the username(s), event type(s) etc. that were already in use in the URL. Eventually I realised I was having difficulty because up to now all the cuts I’d enabled had been based on the attributes of the data itself - event type, user name, qualifiers etc. Pagination is more arbitrary, just showing whatever part of that full data set the user / view has chosen - thus it makes sense not to mix the two things together, and to leave pagination to the query string to deal with.

Hmm - I could probably explain that better, but I think it already might have taken me longer to write this post than it did to write the code. There’s a lesson in there somewhere…