archive: August 2008

31
AUG
2008

As I told you about ~ two weeks ago, I updated the base code of WordPress to allow multiple gallery support making myself do:

[ gallery group=”2″ ]

… and it would show just the items in group 2. I also made it so I can designate items that I didn’t want part of the gallery system. So images could still be posted by themselves and also have a gallery that would show the items in that gallery. The default functionally of WordPress does not allow this so I had to dig deep into the WordPress code to do this. Now I am basing all this code of 2.6.1 and will be submitting it to the WordPress team for them to work on more and make it more efficient.

This was the first version of the work I did. As you can see, all the groups have to be manually changed. No real fun there.

1st Version of the Gallery Groups

1st Version of the Gallery Groups

But I knew I could do better and with an encouragement from a fellow WordPress user on the ticket I submitted to the WordPress team, I went ahead this evening and worked on this:

2nd Version of the Gallery Groups

2nd Version of the Gallery Groups

Everything works minus a few bugs.

  • Order numbers sometimes are wrong. That is because of the blank item at the top that does not have an order value. I am working on a solution.
  • Group Management: Adding & Deleting, which would go to the non-group section. This is going to be a little bit more challenging.

Update Sept 1st 11:40am: This morning at 5am I have completed the one minor bug and you can add and delete gallery groups from the system.

I even made a few improvements in the /wp-admin/includes/media.php file so that when you do insert an image the “title” tag is added to the link so Lightbox picks it up. A problem WordPress seemed to have from the start. In any case… I should have the full patch file on the same ticket (I posted above) in a few days while I work out the kinks. No stone left unturn!

Comments 3

Commenting is now closed

Shane, excellent work. I’ve just started playing around with the wp gallery in 2.6.1 to hopefully replace previously used external gallery systems, like Gallery2. Whilst WP will probably never be as complex as such systems, you’ve solved one of the problems about dividing up the posts uploads into definable, more usable groups. This opens up a greater cghoice of options.

I’d be interested in knowing whether you’ve sorted out the slight error in the gallery uploader that often reorders the images. I know other have had a problem with this. If you have a gallery of 50 or more images, it can be a chore having to order number them all.

I’ve checked out your ticket for this. Could I be cheeky and ask for the text of the full files, the ones you’ve modded? I’d like to play around with this between now and November. I’m no programmer hence my request. It would be most appreciated.

In the mean time, well done and I’m sure many WP users will love this addition you’ve made.

B

hah. Yeah. I am STILL having problems with the re-ordering bug. I just switched over to 2.7.x here on this live version and it works.

Don’t really want to send you the full files though. If you know how to use a SVN, you could merge the patch file with the trunk and the trunk of 2.7 and the files would be updated as such. Or two months of waiting is very easy. 😀 I made a minor update to the ordering system, but still have the order bug, but haven’t updated the patch file in the ticket as of yet since I only made the changes an hour ago.