September 22, 2008

If it isn't broke don't fix it

I've wasted too many hours over the last couple of days playing with MovableType 4.2 only to find out that I don't really need it. Granted there are some nifty new features in it, but it feels much slower. I attempted to speed it up using mod_perl but met great difficulty. I didn't even get around to making sure that all of my plugins were doing the right thing since half of the ones I had I think I saw on the don't use with MT4 list. Thankfully I did all my upgrade testing in a separate copy of my database and published to a new location so nothing got lost.

If I was starting a brand new blog I'd still strongly consider using MovableType but given all of the customization of templates, plug-ins, and pages I've done to my existing version it was turning into too big of a task without enough gain. Too bad I didn't have that foresight yesterday when I started down this doomed path.

Tags: movabletype neophi

May 31, 2006

FireFox Commenting Error

It looks like the FireFox upgrade has broken submitting comments on Movable Type 3.2? I've opened a trouble ticket with Six Apart and I'll see what that gets me. In the meantime IE, Lynx, and pretty much anything else can submit comments fine.

Tags: bugs comments firefox movabletype

May 31, 2006

Hacking Movable Type

While playing with the new tags feature I started with adding it to the main page of my site. The problem is that my older posts don't have any tags associated with them. The naive approach would just attach an empty "Tags: " line to each of those old posts. But even for my unskilled UI hacking skills that would be lame. There doesn't seem to be any kind of way to get the count of the number of tags associated with an entry in the API. Doing some digging I did run across the MTIfNonEmpty template tag. I figured I could use that along with the MTTagsList widget to determine if a post had any tags.

Alas, it didn't work. Looking at the generated HTML there was a lot of excess whitespace. Thankfully I stumbled onto the trim filter. The documentation seems to indicate that the trim filter applied to the MTIfNonEmpty template tag would solve my problem.

Alas, it didn't work. After adding some debugging output to the MTIfNonEmpty template tag and the trim filter it looks to evaluate the value returned by the tag before applying the filters to the value. As a result the whitespace isn't getting trimmed correctly. Instead of trying to figure out why the call order looks to be out of order, I decided to take the easier approach and modify the definition of the MTIfNonEmpty test. The diff is below:

*** ./lib/MT/Template/ Wed Aug 17 17:50:11 2005 --- ./lib/MT/Template/ Thu May 4 23:54:42 2006 *************** *** 493,499 **** my $handler = $ctx->handler_for($args->{tag}); if (defined($handler)) { my $value = $handler->($ctx, { %$args }); ! if (defined($value) && $value ne '') # want to include "0" here { _hdlr_pass_tokens($ctx, $args, $cond); } else { --- 493,499 ---- my $handler = $ctx->handler_for($args->{tag}); if (defined($handler)) { my $value = $handler->($ctx, { %$args }); ! if (defined($value) && $value !~ /^\s*$/) # want to include "0" here { _hdlr_pass_tokens($ctx, $args, $cond); } else {

In short the template tag now considers any value that is only whitespace as being empty. I think given the nature of HTML (or XHTML) and optional whitespace, that this is a reasonable interpretation. Now to add the tags to other pages on the site, tag some of my older posts, and then see what my tag cloud starts to look like.

Tags: movabletype mt programming tags

May 31, 2006


I'm trying out a tagging plug-in for MT. I've not decided how good it is, but I figured I'd give it a try. It's called Tags.App. They have a nominal donation request, which is why I'm interested in trying it before spending any money. My first issue, like I've complained about in the past, is that the documentation for the product is pretty bad. I'm not an MT hacker by any means and the minimal documentation left me out in the cold. I'll have to see if I can figure out enough to make it work.

Tags: movabletype mt tags