Image Gallery

Introduction

Image Gallery Final Screenshot

This seemed like a good project to work on, so I took a stab at creating a feature that implements the ability to drop in an image gallery into a blog post. It does this by loading up all of the assets that you have in the blog you are posting from, and putting them into the dialog box, which allows you to select the ones you want, and then when you click "Add Gallery," it will generate a table containing all of the images that you selected, in the order that you selected them. It's based on JQuery and the JQuery UI toolkit, and it doesn't have to write anything to the database in order to do its thing; the gallery is generated by JavaScript and simply inserted into the page/entry you are working on.

There is a minor bug in the user interface for Internet Explorer users. See that red selection above in the screenshot? That's a border that goes around the selected image, and that doesn't get put on the image in IE. Nothing else seems affected.

License: MIT and GPL in keeping with the JQuery UI toolkit. I borrowed some code from one of their samples, and the applicable copyright notices are in the source code for the JavaScript.

How to use it

 

Image Gallery Load Button

Click on the button that is highlighted in the screenshot to the right. That is the button which loads the Image Gallery dialog box within the entry/page editor. Give it a little while to generate thumbnails of your image assets. The first time that it loads, it will have a lot of thumbnails to generate, but subsequent loads should be a lot faster.

Image Gallery DialogThe image dialog should now be displayed, and show a number of thumbnails on the left hand side of the dialog. Drag and drop the images from the pallet on the left side to the one on the right side to create a new gallery. While a thumbnail is selected, you can adjust its size and position in the gallery using the controls on the right side of the dialog. You can also control the number of columns that will be created in the gallery using the controls on the right. Once you have created your gallery, just click on the "Add Gallery" button to add the gallery into your current entry or page.

If you want to search based on tags, click on the arrow next to "Search" at the top of the dialog. Enter in tags, separated by commas, and click search to get images that have been tagged with those tags. A blank search query will reset your search results back to the entire gallery. Finally, you can set up a list of default tags to be used for limiting the images that are loaded by default in the preferences for the Image Gallery plugin while in blog view.

 

Image Gallery Preferences

 

Downloads:

 


Changelog:

  • 1.5
    • Added basic search
  • 1.75
    • Adds asset tracking
    • Adds a buffer between the table the rest of the entry.
    • Adds the ability to specify a series of "default tags" which limit the images shown when the dialog is first displayed.
    • Fixes the issue of the "columns" controls saying "rows."

Known Issues:

  1. (As of 3/16/2009) This only works with the default Movable Type rich text editor.
  2. (As of 3/16/2009) Performance issues with large asset libraries.
  3. (As of 3/16/2009) Border issues around thumbnails in Internet Explorer.

Feedback:

Comments? Suggestions? Bugs? Post away in the comments section.

If you like this work, please consider rattling the ol' tip jar!

No TrackBacks

TrackBack URL: http://www.codemonkeyramblings.com/mt/mt-tb.cgi/632

14 Comments

Doesn't seem to work. I'm using 4.21-en with Community Pack 1.6, Professional Pack 1.2

I assume this pops up AFTER you click Save when creating/editing an entry. Nothing pops up.

If there is supposed to be an 'Add Gallery' ON the Edit Entry screen itself, I don't see that either.

I tried a test entry with 2 uploaded photos. I have the FCKEditor plugin installed, but that shouldn't affect it.

Also tried Arvind's AssetGallery and it too doesn't work. Doesn't seem to add the custom field needed. (have seen others say they couldn't get it to work either)

ideas?

The FCKEditor plugin probably changes the layout of the entry editor, and if that be the case, then this plugin wouldn't work. Can you try disabling that plugin?

Thanks Mike. That was indeed the issue. Works fine with the regular Rich Text Editor.

I figured it out while also trying your EntryImage plugin, which also doesn't work with FCKEditor.

shoot. Now I need to figure out how to add custom buttons to FCKEditor I guess.

That's one issue that 6A should warn users about when changing their editor. I wonder how many plugins get messed up by this behavior.

On the gallery dialog, it says "Will create: 3 rows"

I think it should be "Will create: 3 columns"

Apart from that, brilliant!

Moveabletype needs to integrate something like this into its core. Adding pictures one by one and formatting by hand is just ridiculous.

Props for doing something about it.

Hi Mike,

Finally got around to trying out your plugin here. I use the YUIEditor, and while I could add your button to it, the plugin currently stretches or shrinks the thumbnail into a square image, rather than cutting off the extra height or width, such as Byrne's new Photo Gallery plugin does.

Could you modify this to not stretch the square thumbnails? As I like the square thumbnails, just not the stretching.

Ken

Is there documentation on how to use this??

What part are you confused about?

I installed the plugin and was prompted to "upgrade". I don't see how to use this in the interface. Is there a button or something that should show?

Please refer to the documentation above.

I installed this plugin, and when I call it up I see the asset images on the left box, but I cannot drag and drop into the right box.  Nothing happens.  Paul.

What browser are you using, and how did you install the plugin?

Good one, galleries can be useful at times especially for projects etc

Thanks for posting them

Excellent information. Finding a few such solutions has taken hours in the past.

Thank u.

Leave a comment

July 2009

Sun Mon Tue Wed Thu Fri Sat
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  

Tips

OpenID accepted here Learn more about OpenID

Creative Commons License
This blog is licensed under a Creative Commons License.
Powered by Movable Type 4.261