Archive for the ‘Wordpress’ Category

Snippets And Photo Albums In Wordpress 2.5

Since I made the switch from blogging platform Movable Type to Wordpress last year I’ve never looked back. Not only is it easier to customise the theme, easier to extend the platform itself in any way you can imagine and has an enormous user and developer community, but every version just gets better and better. The most recent release - 2.5 - comes with a completely redesigned administration section among a host of other cool things. Since everybody hates change (we all get used to doing something in a certain way and learning to do things differently is painful) there were quite a lot of negative comments about the redesign initially, but these have quickly quietened down - and I have no doubt it’s as a result of the user experience being a hell of a lot better. It’s amazing how a piece of software can make you feel more creative but that’s exactly how I feel when I log into my installation of Wordpress.

Anyway, I thought I’d take a moment to explain a couple of changes I’ve made to the layout of this site and how easy they were to implement in Wordpress. Firstly, snippets. You may notice some posts that instead of having a big banner with the title, the date underneath, the post itself and a link to the comments at the bottom, they have a blue bar to the left, no big banner and… Well, in short they look like this:

I'm just a screenshot, you can't click on me!

I felt the weight of expectation of my site’s design bear down on me every time I wanted to post something. If all I wanted to do was put up a link to something interesting I could hardly justify writing a full article about it and a one-sentence post just looked wrong. So I wouldn’t post. I saw that Matt (that’s Mr. Wordpress to you) creates mini-posts when he wants to say something briefly so I pretty much copied his layout (I hope he doesn’t mind)! What is it Picasso said? Good artists copy, great artists steal…

Next, I’ve wanted to post more of my photos to this site rather than over on Flickr but have never had a really neat way to do it. I had on my to-do list “investigate or write a photo gallery app” for ages. Well, fortunately Wordpress 2.5 supports image galleries and I could finally get my wish! Out of the box the image galleries don’t do much but since Wordpress is endlessly extensible it didn’t take me long to display a gallery as a single image with a description and link that takes you to the actual photos:

I'm just a screenshot, you can't click on me!

Each photo is a post in its own right so can have a description, has links to the previous and next pictures and can accept comments. It’s simple, effective and all I really wanted out of a photo app. Since Wordpress reads the EXIF information of all the photos I upload (that’s all the data your camera sets in the picture file like the shutter speed, date, time, etc.) then in time I can change my design to show more details about them as well as other related photos. In fact with only a few tweaks to my templates I could pretty much replicate your average Flickr photo page. Not that I will mind, I want to keep it simple and not spend all night every night redesigning my site!

Anyway, with Wordpress I was able to make these changes quite easily and only required a few lines of code added to my template. And the really cool thing is that whereas in my old Movable Type days (note that I used MT3 and MT4 is now available so my knowledge is out of date somewhat) if I had an idea for a way to change my site I’d likely give up as it would require a lot of investigation and work to get it implemented, but it feels like with Wordpress I can turn an idea into reality in less time than it took to write this article. Which in the case of snippets and photo albums is absolutely true.

Another Satisfied Wordpress User

Well no sooner had I written that I was pondering switching blogging platforms from Movable Type to Wordpress than I started actually doing it. One of my many character flaws is that once I get an idea in my head I tend to go 100% all guns blazing and don’t stop until I’ve done it and this was no exception.

Having been a Movable Type user for several years I’d not paid a lot of attention to Wordpress other than installing it and having a quick look at it a couple of times. Version 2.3 was coincidentally released just at the time I was thinking of moving my site so I took it as a sign to proceed.

I must say, I’m very very impressed with Wordpress. Writing good software that’s easy to use, powerful and fun is very difficult. There aren’t that many people out there that can really do it. But writing good software that’s easy to use, powerful, fun and easy to extend is much harder. Wordpress manages to do this very well, better than any software that I can think of. While I know PHP quite well, I hadn’t used Worpress at all yet within 4 evenings I’d managed to do the following:

  • Import all my posts and comments from Movable Type
  • Create a theme that looked exactly the same as the old site but used the new functionality that Wordpress offers (such as improved comment handling)
  • Write a plug-in that changes the Wordpress WYSIWYG editor to be just the way I like it and tweak the RSS feed to be just the way I like it
  • Migrate the ‘My Software‘ section of this site over to Wordpress Pages - a much better way to handle things

To an experienced user of Wordpress this is all pretty straightforward stuff, but I’m not an experienced Wordpress user. Up until a couple of weeks ago I’d never so much as looked at the documentation or actually written a post with it. Now I’ve moved my site to a different platform, haven’t broken any links and it all seemed far too easy - which I like!

Wordpress on John’s Adventures

My point is that to do what I’ve achieved as a novice MT user moving from Wordpress to MT would have been a far more serious undertaking (note that I’m talking about Movable Type 3.x here, I can’t comment on MT4 as I wasn’t impressed enough with it to see what’s changed under the hood). I’d have been able to import my content no problems but creating a theme is a lot harder in MT - they’re stored within the database whereas the theme files in Wordpress are files in a folder making them easy to copy onto a test server where I can get things right then simply copy to my live site. With MT I’d have to do a lot of copying and pasting or database updates - not ideal. I’d probably have ended up just using the default template and tweaking that rather than using my existing lovingly created and evolved layout. Of course, some might argue that’s a good thing…

The documentation for Wordpress is also worth a mention - whether you’re modifying themes, writing plugins or just trying to figure out how it all works. It can be a bit tricky to find what you’re looking for in the MT documentation (or maybe it’s just me) but the Wordpress docs rock. Whenever I was stuck trying to figure something out when creating my theme or plugin the solution was easy to find and explained thoroughly. Feature-wise I think Wordpress and Movable Type 4 are pretty much on the same level but I find Wordpress to be faster (on my server at least) and with a far more active community in terms of themes and plugins - which is always a good sign for a product. In fact there are so many plugins out there it makes my head spin!

I know they say “a change is as good as a rest” but it’s more than that. I actually feel more inspired since installing Wordpress. I can’t put my finger on why but when I log in and look at the clean, slick interface I just want to write something. Which is great news for me - but bad news for you, the poor reader. So I’ll apologise in advance and you can just blame the developers of Wordpress - it’s their fault for doing such a damn fine job! :)

Stick With Movable Type Or Twist To Wordpress?

I’ve been using Movable Type as the power (with a capital ‘P’) behind this site for the last few years and I’ve been pretty happy on the whole. One thing that was missing was a decent WYSIWYG editor (so that when I write a post I can see how it’ll look when it gets published) - but I sorted that one out by using TinyMCE. Another was comment spam but I fixed that with CAPTCHA. Everything was great, it was working happily and despite the fact that I really liked the look of Wordpress (more about that later), I was happy to stay put.

Then recently Movable Type 4 was released. I installed a beta version to have a play around and I really liked it. It’s organised similarly to Wordpress (which is much nicer to work with than Movable Type 3) and it seemed very slick. That is, until I tried editing a post. Six Apart have implemented their own WYSIWYG editor and, to be frank, it’s nowhere near good enough. I never find myself switching to the plain HTML view to fix something TinyMCE has messed up and it was only when testing MT4’s rich editor that I realised just how good TinyMCE is. MT4 produces some real garbage HTML underneath, doesn’t let you edit the properties of images you’ve placed such as the CSS class or style you’d like to apply to it (unless you switch to HTML view), doesn’t support tables (except with HTML view) and when creating a new post it doesn’t even surround the text with paragraph markers (unless you switch to HTML view) and you end up having lots of line breaks entered instead of paragraphs. These things may seem minor (and there are many more) but they’re annoying enough for me to not upgrade my installation. It’s the 21st century, I shouldn’t have to be hand-coding HTML to produce a basic, standard blog post about my hair or new football boots.

I have attempted to write a plug-in to get TinyMCE working with MT4 but haven’t managed it thus far - the entry editing page is quite different to the MT3 one and is proving rather tricky! Plus I’ve not really sat down and dedicated a lot of time to figuring it out.

I will say though that there are plenty of other slick features I like such as being able to create pages (a la Wordpress), manage uploaded files (such as pictures) more easily, some more powerful template tags, finer-grained user permissions, better look-and-feel and just basically a more logically organised front-end. But until I manage to use a better WYSIWYG editor, I won’t be upgrading.

Which brings me onto Wordpress. Many times over the years I’ve been tempted to migrate my site over to Wordpress. It’s been ahead of MT for ages in terms of features and the fact that it’s written in PHP (which I know) rather than Perl (which I don’t and don’t particularly want to) makes me like it more. The latest version - 2.3 - has just been released and after installing it I’m impressed. The management pages are much faster than MT4’s, nicely laid out, and best of all - it uses TinyMCE for entry editing! I can quite easily write a plugin (plugins are incredibly simple to write since they’re PHP which I know as I said) to use the same options I use in TinyMCE on my current MT install. I’ve looked into migrating the content (pretty straightforward) as well as the layout (time consuming, but not hard) and maintaining the links structure so no links get broken and it’s mighty tempting.

Of course, you as a reader couldn’t care less, you see the output, not the tool that creates the site. “So why are you telling us about this John?” I hear you say - to which I reply that “you’ve got some attitude mister!”. Well I spend most of my time in Movable Type and very little of it actually browsing my own site, and you know what they say: a change is as good as a rest!

I know that the sensible choice is to just stick with what I’ve got now. It works and changing platform won’t really make any different to those reading my ramblings. Just because something is new and shiny doesn’t mean I should instinctively use it. But if I know me I’ll find myself sitting in my house on a rainy Sunday with nothing better to do and then port the lot to Wordpress. Or maybe I’ll properly crack putting a decent editor into MT4. We shall see… And in Yorkshire most Sundays are rainy Sundays!