CCK Gallery
SHOULD THIS MODULE EXIST??
Feedback required. Several people have pointed out the very competent Node Gallery module - http://drupal.org/project/node_gallery
In light of this, and since that developer has more time it seems, should CCK Gallery continue? Is it different enough to justify it's existence? Please let me know! Your voice counts!
Why This Module Exists
CCK Gallery brings together a series of other modules and provides some "glue" code to make them play together and make a nice, per-user image gallery. I created it because I could not find anywhere a decent Drupal-based (no integration) gallery module that supported the Facebook/Flickr/MySpace/etc. gallery model of a set of galleries per user. This does. For the record, Acidfree sort of does too, but it's half broken and not really being maintained as far as I can tell. A similar module in concept (in so far as it uses CCK ImageField for image storage) is Simple Gallery, but it does not appear to have the same "by user" galleries and permissions that CCK Gallery is capable of. The fundamental difference is Simple Gallery uses the Taxonomy module to create gallery groupings whereas CCK Gallery uses a node to group galleries.
What This Module Does
Here's a quick FAQ, since there is already a fair degree of interest in this module:
1. How does it work?
The installation creates two content types. The content types are 'CCK Gallery' and 'CCK Image'. The gallery type is a basic node and is just a container that all related images reference, in order to group them by gallery. It has no fields because the relationship is held with the image content type (each image is in one or more galleries via a nodereference relationship). The clever stuff with the gallery is in the provided template. The template loads a view showing all the images in the current gallery underneath its title and description. Images "know" which galleries they are "in" because they nodereference them. The views module is used, along with hook_menu() and assorted other tricks, to easily present the data and allow you to easily change the way the data is presented. The admin settings for this module (in the Content section of admin) even allow you to select your own views for displaying the various pages.
2. Why do I need the ImageCache module?
The installer also installs two ImageCache presets, 'thumbnail' and 'normal'. Please feel free to adjust these as necessary. By default, each 'CCK Image' will have a version of the uploaded attached image at both of these sizes (as well as original) saved and available for use in views and elsewhere. The 'thumbnail' preset (120x120 max) is for image teasers and the gallery views. The 'normal' preset (800x600 max) is for full node views of images.
3. I installed the module and I don't see any images. What's going on?
The most likely reason for this is you forgot to install one of the ImageAPI's graphics handling modules. Because they are not dependencies as such (you need to select one depending on your system) they are not automatically installed. You must install at least one for ImageAPI to be able to generate images. If you go to the status report for your site (admin/reports/status) you will probably see a big red error message from ImageAPI telling you this. Easiest resolution is to install PHP's inbuilt GD2 image handling support from the Drupal modules page. It's part of the ImageCache package.
4. But the views don't have any 'page' type displays?
That's right - they don't need them because they are either embedded in a template using the views_embed_view() function, which returns mark-up directly, or they are called in a hook_menu() so are, by definition, in a page already. The 'page' display in views is only for if you want to expose a page using only the views module (e.g. it will register a page for you). I've registered a page myself, so this is not required.
5. I uninstalled the module but my content types are still there...
Yes, this is by design. I feel deleting content types on uninstall is a dangerous game. It's so simple for an administrator to manually delete content and corresponding content types, that rather than assume the content is no longer desired I would rather leave it intact and let you decide if you want to delete it or not.
6. I want to create something like this...
You can!
- Add a CCK imagefield to the 'CCK Gallery' content type called 'field_gallery_main_image'
- Create an ImageCache preset for the size you want
- Under display fields for 'CCK Gallery' set your 'field_gallery_main_image' field to use your new preset on Node view (and probably normal thumbnail on Teaser - hide labels too)
- Juggle the field order on the 'CCK Gallery' content type settings so the image is at the bottom, after the title and description
7. The gallery node layouts are a bit, um, basic! How can I change this?
I know. Ultimately I'll provide template files for the galleries which make them prettier out of the box, but for now, to change the appearance of the galleries you will need to modify the appropriate views templates. Please see the Views module documentation for assistance. (Installing Advanced Help makes it easier to browse and use the Views documentation - it's all provided within.) There is also a theming Views 2.x tutorial I wrote which should help you.
The Future
This initial release is quite basic and experimental, but it seems to work. I have a TODO list:
- Add more views for different use cases
- Integrate with Content Access and ACL for granular access control to galleries and images
- Integrate with User Relationships and/or FriendList to allow access for groups of friends
Please feel free to make further feature requests via the issue queue.
ATTENTION: Critical differences depending on Image Field version
In short, there were fundamental changes to the way the Image Field widget works a few releases ago. CCK Gallery 6.x-1.1 addresses these changes (patch thanks to fexpop). The rule is:
Image Field 6.x-2.x - Use CCK Gallery 6.x-1.0 (this is not supported - all new features will only work with Image Field 6.x-3.x - but it works) http://drupal.org/node/417406
Image Field 6.x-3.x - Use/update to CCK Gallery 6.x-1.1
If you choose the wrong version then hook_install() will no longer function correctly.
Developed by: Greg Harvey - http://www.drupaler.co.uk
Sponsored by: CMS Professionals - http://www.cmspros.co.uk
Releases
| Official releases | Date | Size | Links | Status | |
|---|---|---|---|---|---|
| 6.x-1.1 | 2009-Jun-12 | 15.75 KB | Download · Release notes | Recommended for 6.x | |
| Development snapshots | Date | Size | Links | Status | |
|---|---|---|---|---|---|
| 6.x-1.x-dev | 2009-Sep-12 | 18.62 KB | Download · Release notes | Development snapshot | |
