(Tutorial) A simple Ajax image Gallery System For Drupal

Tips : A simple Ajax image Gallery System For Drupal

For this gallery system, you need :

The concept is the following: having a content type with a multiple value imagefield, that are hidden in the node, and listed in a view block that you can display wherever you want.

CCK

So first, of course, install all the required modules. Once they are all installed and activated, go to /admin/content/types and create a new content type that you can call "gallery" or "album"...or whatever you want really!

cck

Then in 'manage field', add a new field with the type 'image'. This image field should have a number of values set to either 'unlimited' or to at least '2'... obviously... Most of the other settings are up to you. It would make sense to have this field required, but I seam to have missed this when I did this screenshot...

cck-set

Then, in the 'Display fields' tab, make sure that you set the 'full node' view as <hidden>. We're hiding this field by default because we will be outputting the images in a view block that we will place right beside the node.


Once you've done this, your content type is pretty much ready to go, we now need to create the magic View. Of course, by using a custom content type, you open your gallery to all the flexibility that the CCK module offer!

ImageCache

Imageca che will make sure that your images are resized to the right sizes for the gallery. You have to create two imagecache profile: one to resize the images when viewing them in the gallery, and one to create the gallery thumbnail. First go to /admin/build/imagecache, and click on 'add a new preset'. Pick a name and then add the action to perform. For the viewing profile, I chose the "Scale" action set to a width of 600px, a height of 300px, and optionnaly you can allow upscaling... [..]

| Read more..

Courtesy : Raincitystudios.com