[support] image gallery - a simple solution

Clarke Robin Robin.Clarke at networkrail.co.uk
Fri Feb 6 12:06:40 UTC 2009


There seem to be quite a few examples of this pattern (CCK + ImageCache + Views + etc) being proposed within the Drupal community as a way of giving users the ability to add images to a Drupal site.
 
There are some things I like about it:
1. The workflow for a user to add images is much simpler than using the Image module (only one node created).
2. There seems to be more flexibility in how the images are displayed (thanks to ImageCache).
 
But there are some disadvantages;
1. Categories cannot be applied to individual images (just to the group of images).
2. Comments cannot be applied to individual images.

One way around this is to use the CCK + ImageCache + Views pattern, but restrict the number of imagefield fields to 1 (as opposed to many). But then this negates the first advantage of simplifying the process of adding multiple images.
 
Does anyone know another way of using the CCK + ImageCache + Views pattern that will allow users to add comments and categories to individual images?
 
Thanks
robin
 
________________________________

From: support-bounces at drupal.org on behalf of John Callahan
Sent: Thu 05/02/2009 18:55
To: support at drupal.org
Subject: Re: [support] image gallery - a simple solution



OK.  I feel rather dumb.  To create a simple image gallery like I
proposed (all photos uploaded in one node then viewed through a
Lightbox-like display,) you don't need any special gallery type of
module.  You don't even need views!  You will need: CCK, ImageField,
Imagecache, and Lightbox2. (but who doesn't already have those anyway!)
    All you need to do is:

1) configure Imagecache with two presets: one for each image thumbnail
(e.g., 100x100), and one for slideshow view (e.g., 640x480)

2) create a new content type for these single-node galleries

3) create one CCK/ImageField field and upload images to this node (make
sure to set the number of items allowed for that image field)

4) in the content type display fields, set the Label to Hidden, and Full
node to Lightbox2: preset-thumbnail -> preset-slideshow.


That's basically it!  To make the images display horizontally, in a
grid-like format, change the style of the div container to
display:inline.  You can put this style inside the page (using Full HTML
filter), in style.css, or in your node-contenttype.tpl file.  For
example, if my content type was called "gallerypage" and CCK image field
"gpimages", then I would use:

.type-gallerypage img{  /* adds frame around image */
border:1px solid #cccccc;
padding:5px;
margin:5px;
}
.field-field-gpimage div{   /* displays images horizontally */
display: inline;
overflow: hidden;
}

There is a post on the D5 imagefield_gallery module that describes
something very close to this.

It's also very easy to create a View for a listing of gallery pages,
with the first image in each gallery as the thumbnail.  Use taxonomy or
more CCK fields to further categorize your galleries.  (Of course, if
you wanted images to be part of multiple galleries, I would put one
image per node and use Views/Lightbox integration. This is the way most
people suggest and does work very well.)

- John

**************************************************
John Callahan
Geospatial Application Developer
Delaware Geological Survey, University of Delaware
227 Academy St, Newark DE 19716-7501
Tel: (302) 831-3584 
Email: john.callahan at udel.edu
http://www.dgs.udel.edu <http://www.dgs.udel.edu/> 
**************************************************




John Callahan wrote:
> I know there are plenty of options for creating image galleries in
> drupal. I've used many of them.   Like most people, I'm interested in
> simple, and like an increasing number of people, I'm not interested in
> using the image module.  CCK, Views, Imagecache, etc.., is the preferred
> way to go.
>
> In the interest of simplicity, I do not want to give my users FTP access
> to my file system, and I'd rather not require them to create a new node
> for every image.  So, does anyone have suggestions for the following:
>
>
> 1) users can create the image gallery on one page/node, such as through
> CCK Image Field or file uploads as attachments
>
> 2) the display of the gallery can be through Lightbox or something similar.
>
>
> Modules like Galleria and Gallerix have potential. They may work with a
> decent amount of CSS work and maybe some changes to the module code. 
>
> I love the method described here
> (http://raincitystudios.com/blogs-and-pods/hubert/a-simple-ajax-image-gallery-system-drupal)
> using CCK/Views but I can't get Lightbox to navigate through the
> images.  Not sure if it's possible here.
>
> - John
>
> 
> **************************************************
> John Callahan
> Geospatial Application Developer
> Delaware Geological Survey, University of Delaware
> 227 Academy St, Newark DE 19716-7501
> Tel: (302) 831-3584 
> Email: john.callahan at udel.edu
> http://www.dgs.udel.edu <http://www.dgs.udel.edu/> 
> **************************************************
>
>  
--
[ Drupal support list | http://lists.drupal.org/ ]



**************************************************************************************************************************************************************** 

The content of this email (and any attachment) is confidential. It may also be legally privileged or otherwise protected from disclosure. 

This email should not be used by anyone who is not an original intended recipient, nor may it be copied or disclosed to anyone who is not an original intended recipient. 

If you have received this email by mistake please notify us by emailing the sender, and then delete the email and any copies from your system. 

Liability cannot be accepted for statements made which are clearly the senders own and not made on behalf of Network Rail. 

Network Rail Infrastructure Limited registered in England and Wales No. 2904587, registered office Kings Place, 90 York Way London N1 9AG 

**************************************************************************************************************************************************************** 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 7788 bytes
Desc: not available
Url : http://lists.drupal.org/pipermail/support/attachments/20090206/35088329/attachment-0001.bin 


More information about the support mailing list