Picture of a judge's wigThis Is Not A BLOG!Picture of a judge's wig



Date: 20/10/16

Let's Split!

As this site has now been running for well over thirteen years, the amount of material on it has naturally multiplied. On my last major revamp back at the beginning of 2013, I decided to break the posts down into categories, if only to make it easier for me, let alone my reader (Hi, Philip!), to find things.

The pages for each category (shown here) have, of course, grown yet further as time has gone on since then. This has created something of a problem, but one I've only become aware of since mid-summer of this year when I tried to view some of them on my newly-acquired mobile phone.

If there is such a thing as a 'smartphone', then there must perforce be such an instrument as a 'dumbphone'. In fact, I know there is, because I have one. What this has meant in practice is that I couldn't view some of the category pages on it; either my phone beeped peevishly at me with the message "Insufficient memory", or it would display the top of the page but wouldn't scroll down beyond that.

Looking into it, I found that my phone had this issue with any page which was larger than about 65kB, and that several of the category pages were quite a way in excess of that. So, this meant that I had to think about splitting some categories over more than one page. This is what I have spent the last three days doing.

In doing so, I have tried to make no page larger than about 55kB (and the few that are at that level are ones which are not going to be added to, as they list entries from prior to the last couple of years).

I had experimented - as a 'proof of concept', i.e., 'do-ability' - with the record catalogue lists linked from here (which were even larger than the overgrown category lists), and found that, yes, it was possible to break them down into more manageable chunks so long as I made new navigation buttons and got the links right.

So I set to it to subdivide the problematic categories - those under the headings 'Funny', 'Me' (the ego is all-powerful), 'Media & Culture', 'Music', 'Politics', and 'Video' - into either two or three sub-sections.

That bit wasn't too difficult, but I found a problem when I tried to put the row of link buttons along the top and bottom of the lists. The block of images was shifted sharply towards the right-hand side of the page, a problem which hadn't presented itself with the record catalogue. After a fair bit of head-scratching I determined that the problem lay with the style-sheet used by the category pages, which was a different one from the style-sheet used by the record catalogue. When I had set up the category pages nearly four years ago, I found that the site's main style-sheet caused the list of posts to shift over towards the right-hand side, and I was forced to create a new style-sheet for these pages, putting in a negative left margin to counter this. Obviously, the same needed doing for the link-button images...

...except that that didn't work very well, in that the left-most image (the '1') moved over to the left, but left a large gap between that and the '2', and there was a similar void between the '2' and the '3'. It took a fair bit of search-engine work, but I eventually came up with something of a kludge in the CSS which more or less works (except in Internet Explorer where - if you resize the window, the bloody buttons lurch over to the right again until you refresh the page. I don't know what's doing that, but - as my sainted mother used to say under similarly frustrating conditions - "Oh, arseholes to it!").

My work wasn't over once that had been done however, because each post in the categories which had been split up needed to be amended to change the link to the relevant category sub-page. With the total number of posts to this site now in excess of 1400, and with most of those falling into one (or more) of the now-divided subject headings, this has taken me nearly all day (in between going out to post a charity donation, going down to the chemist's to get my 'flu jab from Sławo the pharmacist and calling in at our bijou Post Office to buy stamps). I desperately needed to get it done before about 2000 this evening, because I have a post which has to be put up immediately after midnight tonight because it's what might be called 'date sensitive', and because I spent two or three hours putting it together on Monday evening.

Well it's done now, and I've uploaded all the changes to the server. I am quite sure, however, that I've cocked something up; when you do so much copy and paste, the eyes glaze over and the fingers go on to auto-pilot. I've also only been able to put a small random sample of the changed pages through the HTML validator because of the time limitation I mentioned in the last paragraph. If anyone spots a broken or incorrect link, I'd be grateful for the information, because I know how frustrating it is when someone else's site suffers from that.

Just for clarification, the sub-pages are numbered with '1' being the earliest in each case.

I have another project - again related to how the site, and the category pages in particular, looks on mobiles - which is proving to be a proper bugger to sort out. This stems from the fact that those pages - and a few others - are based on HTML tables, which take up a lot of the file size of those pages where they feature, causing the same problems as I have (I hope) just solved. In theory, it should be possible to remove this problem by using CSS to create the equivalent layout but without so many lines of code on the individual pages itself. However, nothing I've tried so far seems to provide what I need, in that either the columns in full-screen (on this 'ere PC, for example) are too widely spaced across the page, or that - when the dimensions of the table are changed to stop that happening, the page when displayed in a viewport the same size as on a mobile has some of the columns over-writing one another. It's back to the drawing board with that one, but I hope that splitting up the pages worst affected will at least buy me a bit more time before I have to address it again.