Gregory Brine

My node of the web

My Second WordPress plugin. This time it’s a gallery

| 0 comments

I feel I need to start this blog by reliving part of my old site. When I went travelling back in 2005, my friend Pete and I had been working on building our own CMS/site combo in PHP. The tools we built allowed me to easily upload my travel photos and link them to my blogs. It was quite proud of what we did and the detail we put into it:

  • Each photo had its own page – great for SEO
  • Each photo had its own URL – even better SEO
  • Everything was sized automatically when it was uploaded
  • You could comment on anything
  • Everything was related through the WordPress tags
  • It handled itself well (I hate errors)

All in all, it was a pretty good system.

Fast forward to today and I’ve changed to a completely WordPress based site. I love WordPress. The way it handles content is unparalleled – other than by systems I’ve built in the past – and it has given me a lot of opportunities and it’s a platform I recommend to my clients at Amnesia Razorfish when they want a simple, open-source and great solution.

So, I started looking into developing a plug-in for WordPress that could leverage my original gallery, or rather the data and images I still had. This posed an interesting challenge as all the plug-ins I’ve tried that handle galleries in the way I want to require me to create a page per gallery and manually enter a tag for the gallery I want in there. That’s messy and too time consuming.

Looking through numerous forums and help files, I managed to piece together a way to create a single page, paste a tag into that page, and then build all of my URLs out from that point. That means I have a friendly base URL that everything is added to using the format:

/[Base URL]/[Gallery URL]/[Image URL]

That gives me a great foundation to build on and add in pagination, additional image features and keep adding galleries and images without having to worry about creating new pages – I find that a little messy. My plug-in so far even rewrites the titles of the page and back links them (the page title is next on my list).

You can see it in action here:

http://www.gregory-brine.com/digital-photography-gallery/

I’ve also added a widget to the right-hand side that links through from anywhere. And, it evens adds images to blogs that are related to that gallery:

http://www.gregory-brine.com/2006/04/05/noosa-australia/

The admin side of things isn’t finished yet – that’s going to take a little more work – but in the meantime, I’ve got my old much loved and much missed galleries are back and on their old URLs.

Next on the list to be done:

  • Link to WordPress tags
  • Add a lightbox for opening the image fully
  • Add in commenting – going to try and use the WordPress built in commenting
  • Build the admin system – yeah… that’s a biggie

Let me know what you think and if you have any comments.

Links



Author: Greg Brine

Web developer from London, working in Sydney using OOP PHP, MySQL, HTML, CSS and Jquery to develop Facebook Apps and Wordpress sites. Developer by day, blogger, amateur photographer, Xbox & car nut the rest of the time

Leave a Reply

Required fields are marked *.

*