I’ve been doing a lot of backend work on the site for the last few weeks and I’m happy to say that it actually works, and quite well! What I’m referring to is my new way to pull in images to posts, and display them. Example below (not going to work in a feed reader):
It’s Better!
Now this is pretty much the same as what I had before, but with a few key differences. All the information in the lightbox is pulled directly from Flickr automatically, it’s cached for speed, and it updates dynamically (meaning changes I make to the metadata on Flickr migrates here). It also includes a link to Flickr so you can download larger images, comment on the photo, or add them to your favorites. But the best part is that all I need to do to pull in an image is include: [flickr]photo:1364872177[/flickr] anywhere in the post. I can also use tags or usernames to pull in photos.
The Benefit
The major benefit to that besides just the time that it takes to write these posts, is that I can continue to improve the system without having to edit all of my old posts. If I want to say, make the lightbox image depend on the viewers screen resolution, all I have to do is edit some backend code rather than a hundred posts. And if the viewer doesn’t have javascript enabled, or is reading my post in a feed reader, the link should take them directly to the flickr page (rather than hotlinking the image like most lightboxes do). I’ve gone back and converted all of my old posts to the new format, so take another look at my photo category if you haven’t seen it already, all the links now work again!
The Code
Of course I still suck at coding something entirely myself, so this all runs off of heavily modified versions of Flickr Tag for WP and Slimbox 1.4.1. It’s a bit on the ugly side, but if anyone is interested in seeing how I did it I could release the code. I’ve only been able to do limited testing, please let me know if there are any problems in the comments!




No Responses to “More Fiddling With Lightbox”
Leave a Reply