Getting iBox to Work With Textpattern

Hello fellow nerds!

I’ve been using Textpattern for my client sites where they want a portfolio consisting of a small gallery of images for each of their projects. I also wanted to do something different than an image pop-up, which requires some maintenance and can be difficult to train clients on if they aren’t as geeky as I.

In order for multiple images to be associated to an article in Textpattern, a plug-in is necessary. I used the excellent zem_article_image plug-in found here (documentation here) written by Alex Shiels. The problem is that I also wanted to use a very nifty Javascript called iBox (demo here) that does a nice little efffect with images associated with thumbnails. Since Textpattern builds a thumbnail from a large image, I just had to get the plug-in to spit out a rel=”ibox” in the link tag around the thumbnail. I found what looked like the place in the plug-in code where the image tag was being written and I added the necessary code to make iBox work. Pretty straightforward, but due to my lack of understanding, it took several hours of subtle syntax rearrangement until I had the plug-in spitting out the right code.

If you are interested in the code, you’ll have to first download and install the original plug-in on your Textpattern install. Then edit it and copy/paste the code in this text file. I haven’t heard back from the plug-in author, so if he doesn’t like what I’ve done, I’ll pull down the file.

Hope this helps somebody. I wish I knew PHP better, but getting this to work was pretty much like the scene from Galaxy Quest where the nerd (the person playing the Mac in the most recent Apple ads) realizes that fiction has become reality and freaks out.