Individual Entry

Making life easier

Often, I have a deep fear of upgrading software, whether it be my operating system or the publishing platform I use to maintain my web site. From bitter experience, I’ve learned that, if there’s a way of something going wrong, it will. In the case of Movable Type, I’ve had to relearn a lot of what I thought I knew about the platform in the process of switching versions from 3.x to 4.x as I design my new site. (The hours I put in yesterday trying to get the comments function to work would be a case in point.) Today, however, I finally got to try out one of the main reasons I decided to switch to the new edition: custom fields.

Arvind Satyanarayan originally created the Custom Fields plugin for version 3.x of Movable Type, which was then acquired by developer SixApart and fully integrated into the professional edition of Movable Type 4.x. By default, Movable Type only has a limited number of available fields for each post - e.g. title, date, entry body, extended entry, post time. These are generally sufficient if you just want to blog about your pet cat, but if like me you’re doing something slightly different, such as maintaining a DVD database, this sort of thing is woefully inadequate. In the current iteration of the site, each DVD entry essentially consists of an entry body field which contains a massive block of text and code, providing both the data itself and the layout:

That code is just for a single entry (the BD of Australia), which really amount to very little on screen at the end of the day. Now, imagine that code duplicated around 830 times for my entire collection. That’s just not efficient. Worse, though, it makes updating the collection to reflect a new site design an incredibly time-consuming process, because so much of the layout is hard-coded into each entry.

This is where the joy of Custom Fields comes in. Now, instead of coding the layout for each individual entry, I can simply create a master layout, give Movable Type the code telling it where to put the data for each field (corresponding to things like region code, director, cover art, rating out of 10, review link where applicable, and so on), and enter the data into the Movable Type database. Here’s the master layout code:

That’s it. Don’t worry about trying to understand the code above - the point is I entered that once and now simply add the required information into the database for each entry. “<mt:EntryDataDirector>”, for instance, tells Movable Type that I want to display the director associated with this entry, so it calls up that information from the database and places it automatically:

Hardly rocket science, but it’s streets ahead from what I was doing before. Of course, I do have to re-enter all my data, but that’s far more straightforward when you’re just copying text into the correct fields and letting the database worry about where to put it all. You can see the new system in action here (at the time of writing, I’ve entered the first 80 discs in my collection).

Now, if you’ll excuse me, I’ve got some serious button-mashing to do. In the meantime, here’s a picture of Hollywood’s finest thespian, Lindsay Lohan, to tide you over:

Comments

1.

Nice isn't it =)
I've done a similar thing in wordpress with my list of videogames on my own blog.http://blog.svalas.net/?page_id=99
But I'm currentrly working on my own backend in php for handling it all, both for my movies and games. (have a couple of thousand DVD's and hundreds of games for all the different formats...)
I like your navigation in the new layout... think I'll be stealing it for myself ;)