by Jeff Eaton on June 1, 2009 // Short URL

Photo galleries with Views Attach

A quick screencast demonstrating a new technique for building photo galleries in Drupal with Views and CCK.

Update: An encapsulated version of these settings has been exported for use with the Features module -- it should automatically handle the dependency tracking.

Update 2: An additional 'raw' export of the views, css, and content types is now available for download as well. For those not using the Features module, it should get you started. The ImageCache presets will still need to be set up, but the rest is there.

Jeff Eaton

Senior Digital Strategist

Want Jeff Eaton to speak at your event? Contact us with the details and we’ll be in touch soon.

Comments

eaton

Yep...

That's actually my next step. Since features covers imagecache, views, and CCK right now it should all come together nicely!

Reply

NonProfit

Thanks!

This is great stuff, thanks a million!

Reply

Eric

A couple of questions -

A couple of questions - using this gallery setup as a base, what would need to be done to have the images uploaded into each gallery be saved in a different places in the 'files' directory based on the Gallery name?

Secondly, would it be possible using node reference to have sub-galleries within main galleries? And given that, having the uploaded files reside in different directories depending upon the gallery and sub-gallery name?

An excellent video! Kudos!

Eric

Reply

eaton

Tokens for imagefield?

The Imagefield module can use tokens to determine the directory name, as long as Token module is enabled. That SHOULD enable you to use the gallery name token, but I'd have to double-check.

I don't see any reason why a gallery couldn't point to ANOTHER gallery as its parent, though the grid view would have to be tweaked -- right now it's only set up to pull in the 'image' field itself, which gallery nodes don't have.

Since it's a fairly flexible view, and the only thing that REALLY matters is the existence of the nodereference field...

Reply

Ryan

Scallywag... I was just

Scallywag... I was just about to post up a gallery recipe with a bit of code I've written to glue together about 10 different modules for photo galleries. Now I'll look like a cheap imitator. : P

Minor differences are I'm using Taxonomy instead of Node References with Taxonomy Menu to build a handy menu block for it all. I don't need to tell you, but I also liked using Custom Pagers to add next / prev buttons on individual images.

Reply

joe

RE:Scallywag... I was just

Do you think you could post yours or give me the details... your way sounds a lot like what I am trying to do.

Reply

Jonathan

Just for the Kitty?

Jeff,

Great tutorial.. Did you make it just so you could attach the kitty video at the end? Thanks for the heads up and keep rockin.

Jonathan

Reply

Zach Harkey

Great screencast. Cool technique... but

Thanks for the excellent screencast. Your technique was very well presented and easy to understand.

But for most use cases (including this very example), you can easily achieve the exact same result with a single content type 'gallery' and an imagefield configured to allow multiple values with titles and description fields enabled. It takes a fraction of the time to set up and doesn't require the overhead of 3 additional modules. Perhaps most importantly, by using a multi-image imagefield, you gain the ability to drag-and-drop reorder your images arbitrarily.

I realize this is a simplified example for the purpose of demonstration. If each of these galleries were to contain hundreds of images with several more fields, submitted by dozens of users, then this technique would be a little more compelling, and perhaps that is the whole point.

Still, I argue that the ability to drag-and-drop reorder images arbitrarily is a must-have feature for any image gallery tool. That and the ability to batch upload multiple images, which this technique doesn't address either.

Especially now that our users/clients can easily perform both of these tasks in so many commonly used web applications (e.g. Flickr, Picasa, Facebook, etc.), they expect their CMS to do the same.

Can you think of any reasonable way to extend this technique that would address either of these features?

Thanks again for the great screencast.

Reply

eaton

Yep!

There are a couple of approaches that could all be used. The order in which items appear is a function of the view they're displayed in -- I sorted by post date, but they could be sorted by order in a nodequeue, by 'Flag Weight' ordering, or any other mechanism. Putting a jQuery UI based drag and drop front end on those bits of data is left as an exercise for the enthusiastic viewer. ;-)

One of the reasons I went this way, rather than the 'Gallery node with multivalue image field' route, is the ability to let many users post images to a single gallery without editing the gallery node itself. This method also makes it much easier to support Flickr-like features such as multiple resolutions per photo, per-photo permissions, and so on.

Because this is wired together with relatively simple parts -- Views, Node References, etc -- there's a lot of room to grow and a lot of room to layer on more focused UI tweaks.

Reply

rock soup

Feature Import

thanks for posting the Features export of your screencast. Unfortunately I have hit a bump getting it to work. I have all the modules installed and can enable the feature @ admin/build/features but I do not get the view you built. I get the Imagecache presets and the CCK type, but not the view. Any chance you could export the view and attach? Or try importing the feature to confirm it works?

Thanks and good work.

Reply

eaton

I'll give it a shot...

...I'm pretty new to the Features module and I'm not quite sure how it all works, but I'm trying to come up to speed as quickly as I can. I'll get a fixed version up as soon as I can!

Reply

JT

Nice Job :)

That was very simple and easy to follow! What would it take to build a block with 5 thumbnails; 2 previous images, the current image, and 2 next images?

That would be great for navigation because once you are on the actual image node, you are stuck in a non intuitive page. Either have to click back, or lose your position. Would be great to just be able to click on one of the thumbnails to advance and navigate through the gallery.

Thanks!

Reply

eaton

Custom Pagers?

That's the sort of thing that Custom Pagers module attempts to do. That module is "nice" but can be pretty tweaky at times.

Reply

JT

Yeah, I've had mixed results

Yeah, I've had mixed results with Custom Pagers. The images don't always match up for me, and was a bit confusing to set up. Isn't it also quite taxing on the database query?

Have you used the prev_next api module? Looks good, but it's new and I haven't had a chance to try it yet.

Reply

JT

Yeah, I've had mixed results

Yeah, I've had mixed results with Custom Pagers. The images don't always match up for me, and was a bit confusing to set up. Isn't it also quite taxing on the database query?

Have you used the prev_next api module? Looks good, but it's new and I haven't had a chance to try it yet.

Reply

zz

Batch Uploading

Any suggestions/ideas on how to do batch uploading with this recipe?

Reply

eaton

Webdav!

Actually, I'm not sure. Bulk uploading is a tricky issue no matter how you slice it right now, and it needs separate attention.

Reply

ChrisBryant

Similar approach & additions to this

We had something similar to this setup and also included a few additional goodies:

Check out an example here:
http://gallery.graviteklabs.com

Nice work and thanks for sharing!

Reply

sasi

hi, really great

hi,
really great work.your example - "http://gallery.graviteklabs.com" is simply superb.I have created a photo gallery as described by Jeff Eaton in http://www.lullabot.com/articles/photo-galleries-views-attach

but problem is that i am unable to display those galleries in nodes other than home page. also i was wondering how to give the menu link (galleries) the one you gave in your example - http://gallery.graviteklabs.com. I have tried in many ways to give the menu link but it was unsucessful.as a great gift i saw your example site. so could you please tell me how to make menu link to galleries where it displays all the galleries in the site

Reply

Dogboy

Viewfield + node reference

Thanks for the tutorial. I may use this to replace my fast galleries.

I use a custom content type with two fields - Image and Node Reference. The node reference can have multiple values so an image can be associated with different nodes. This works well for my site because we may have an editorial image (we design wedding gowns) that should be in our "Press Gallery" and also on the product page.

I create the gallery using views and embed it in the appropriate node with view field module. I haven't tried views attach, but it seems to provide the same functionality with more power.

Thanks again!

Reply

kazakhstan

it's nice

It will be nice to use local-nid (imho, it should be in the core) values in links etc. to do semantic urls - album/1, album/2, photo/1, photo/2 etc. (not album/1, photo/2, photo/3, album/4)

And I will search some lessons by Private album (in a node) and default album creating (like "unsorted") when upload an image (i know, in a node reference we should make master node before creating slave nodes, is it right?)

There can be a perfect gallery with Drupal...

Reply

Bram Moreinis

Problem with Features Import?

I'm very excited to get this working - thank you, Jeff! I'm building a Drupal site for my mother the Interior Designer (http://pmid.org) and even though she is 77 I know she'll have no problem populating the gallery with new photos if it can work like this. It was just her birthday.

However: I haven't used Features / Context yet, so this is my maiden voyage. I began with a clean Drupal install, and I'm getting this error on my /build/modules as well as on /build/features:

Field field_image was not created for photo because a conflict was detected for the following properties: list_field, description_field

The only part of your video that I had a hard time with was implementing the node reference link for creating a new photo. Where does that go, exactly? I built this based on what I could see, and since I haven't used Views_attach before, it wasn't clear to me where the magic happened that made that link show up. I created a view, and saw nothing that said "Add Photo".

I hesitate to post the DIFF from the Features page here....

-Bram

PS - how about attaching the CSS you injected? I mean, as long as you're giving us the Features, you might as well go the whole hog!

Reply

Eric Aitala

Views dump?

Might also be useful to have an export of the View as well... I am having a couple issues with the display of the different Galleries. I was able to get the images within a gallery to display.

Eric

Reply

eaton

Still ironing out 'Features'

I've attached a 'vanilla' export of the views, content types, and css now -- the Features stuff still needs some ironing out, as I haven't worked with that module or its APIs much. Thanks for the heads up!

Reply

Eric Aitala

File empty?

In the views-gallery-views ZIP file the views-gallery-views.txt is empty?

Eric

Reply

yaph

The Node Reference form URL

The Node Reference form URL and Views attach modules look pretty useful. Though CSS injector maybe handy in some situations, I don't like the idea of storing CSS rules in the database. Anyway thanks for the very nice tutorial and module tips.

Btw, wonder on how many Drupal sites you could log in using 'admin' as user name and password ;)

Reply

eaton

CSS Injector

I didn't want to spend too much time on CSS Injector as it was really peripheral to the 'meat' of the recipe, but I should also note that it *doesn't* store your CSS in the database. It stores it in the /files directory, just like the Color module does when you create a custom color variation for a theme. CSS Injector's UI is just a pretty face on editing that CSS file, and controlling when it gets added to the list of includes for the page. That means that CSS aggregation and caching will handle it properly.

Reply

justin

I have a question

First off, great tutorial, and so far everything works great.

I have a question, though. It is sort of unrelated, I guess, but is an add on to my gallery. I added an additional link field to the image content type, that link to sites about the images (the images are book covers and link to the books' official pages), and so instead of linking to it's node, I want the image to link to the same place as the link field under it, and was wondering if that is at all possible to do?

Reply

Lena_d

help! can't delete the content types photo and gallery

Hi,
I tried views_gallery, installed all the required modules, but the views didn't work (from what I read so far I am not the only one), so I uninstalled it again and now I am stuck with the two system generated content types,
how do I get rid of these besides reverting to a backup?

thanks for any tips (even dabbling with the database)
thanks lena

Reply

Aaron Niemi

Here's how to delete (Kind of a hack)

Hi Lena,
We ran into this issue as well, so I looked to see what the url was to delete the others and simply replaced the node type (photo) in the url, then hit enter, it asked me if I was sure, clicked yes, and voila it's gone.

I'm not sure why there isn't a delete option for those content types, maybe a bug (or a feature ;) )

example: Existing node delete url: http://www.yoursite.com/admin/content/node-type/book/delete

replace the "book" with "photo" and click go.

HTH
-Aaron

Reply

Anonymous

Great tutorial

Hi, thanks for your tutorial; I've hit a roadblock. What is the URL for the list of galleries? How do I make this a menu item? Thanks!

Reply

eaton

Just the default front page

In my demo, I didn't do anything special to create a gallery overview page -- I just set them to display on the site's front page, the way normal stories and blog posts do. The Gallery overview page you saw was just a list of Gallery node teasers on the front page.

Reply

SMonsen

CSS

I'm not a CSS coder, but love the simplified stuff you have on your pages. Any chance you could post the css code you used?

Also, the views export would be great. My view isn't quite working out correctly.

Thanks, great post.

Reply

Anonymous

the views export is there

the views export is there it's under the video in a zip file.

I too would like to understand how to place this on a page content type rather than the front page of drupal.

Reply

Donny

add pager

Very nice and helpful video, thx for sharing.

Is it possible to add a pager to the image-node ?

Reply

Mattias

Overview

Very nice tutorial indeed, but I really want to create an overview view for the galleries. I suceeded using node-display but the attached image from each gallery will get linked to the image itself rather than the gallerys nid. Any ideas?

Reply

NonProfit

Add a link to easily add a new gallery.

Jeff, this is a great tutorial. One small tweak that may help some users:

a) Create a new page template, views-view--Gallery.tpl.php, via Theme: Information -> Display output
b) add <a href="node/add/gallery">Add a gallery</a>within <?php if ($admin_links): ?>
c) Rescan Template files

This provides a link which allows admins to easily add new galleries.

Blessings!

-NP

Reply

NonProfit

Whoops!

Forgot to mention; I added a view which outputs the list of galleries to a page. Sorry for ignoring that. -NP

Reply

Eric

Do you add a display to the

Do you add a display to the gallery_photo view? Or create a new view?
Also is there any way to display the latest image along with the gallery title?

Eric

Reply

mellenger

Return Path?

I am following along on the video and when I configure the node reference there is no option for the Return Path. is there another module I need to enable that?

The tutorial is perfect for me right now, we are working on a site to handle our web comps that we show clients. thanks!

Reply

Anonymous

This is great. Thanks! One

This is great. Thanks! One problem: I've been able to build the gallery fine, but I'm having problems with the view that lists all of the different galleries with teasers. I've build the "Latest Image" view as in the video, but how do I actually access that list? I believe the video has this list displayed on the front page, but how do I control where that teaser view is displayed? It's not a block display, so I can't control it's placement in Blocks. Any help would be appreciated!

Reply

Anonymous

Overview page

NP: Did you manage to get each gallery overview image in your page clickable to their gallery rather than the image node?

Reply

Doka

Same problem for me. I can

Same problem for me. I can choose image formats like "image linked to node" or "image linked to image", but no clue how to link to the referenced gallery.

Reply

Kirilius

This is really great. I am

This is really great. I am still not convinced what the best method of creating image galleries is. An alternative method is to use a multivalue Imagefield and have all gallery images under the same node. There are pros and cons in both methods and I'll appreciate some ideas for solving the cons ;-)

1) The above method (a gallery node linked to multiple imagefield nodes)
Pros: Views can be used to present show the gallery in different styles; Custom Pagers DO work.
Cons: No easy reordering; what happens if the parent Gallery node is deleted? This is a huge issue for me as the site will be left in inconsistent state - multiple orphaned images. There must be a way of automatically deleting the images if the gallery they belong to is deleted (much like deleting a folder in the OS file system)

2) Using a single ImageFileld with multiple values to store all the images
Pros: drag and drop reordering is readily available, consistency is always preserved - as images are part of the Gallery node, they get deleted automatically when the gallery is deleted
Cons: the default ImageField edit interface is not very good for handling MANY images. Views usage is more limited. Custom Pagers do not work properly (I cannot easily create a page that iterates through the complete ImageField one at a time set using a pager); Image description (CCK) is not available to Views (difficult to create slideshows with image captions)

Reply

Anders Torsten ...

This does not work with latest Views Attach module

Hi Jeff,

Just wanted to note, that this will not work with the lates views attach module

The default argument (passed with tokens) are not passed to the view from the gallery-pages...

/anders

Reply

Marcus Henningsen

This is true, I just

This is true, I just downgraded to the Views Attach 6.x.1.x branch in order to get this to work.

Reply

Marcus Henningsen

Sorry, I was bit too quick

Sorry, I was bit too quick there. The latest 2.x-dev version has already been patched, and now everything works like a charm.

Reply

Jadd

For some reason, I keep

For some reason, I keep getting a weird bug. If the nid of the gallery is bigger than 9, the view only considers the first character. I know because I configured the title of the argument to show "title %1". The gallery just doesn't work, because of this. I also keep getting this error:
warning: implode() [function.implode]: Invalid arguments passed in /var/www/drupal6/sites/all/modules/views/theme/theme.inc on line 140.
Any idea which module would be responsible for this?

Reply

mattz

Thanks for the screencast.

Thanks for the screencast. It sure would be nice if the view was actually in either the raw export or the features export though...

Reply

wingflap

Pros and Cons - Gallery as Separate Node From Image

First of all, great video! I've been playing around with many permutations and combinations of cck, imagefield/filefield, views, pathauto, taxonomy, advanced taxonomy blocks, and taxonomy breadcrumb.

I've found many helpful and insightful tutorials and examples. In general, there are 2 basic varieties of implementation of image galleries using cck and views. The first is keeping images as nodes linked to gallery nodes (this example). Second is trying to implement with the gallery as the node which contains all of the images for the gallery (multiple imagefields per node).

There are defnitely pros and cons to each one. Kirilius highlighted some of those above. The question I have about which method to use is about storage and performance. Is there significant difference in performance for a site with many galleries with many users where there is a separate node for each image as well as an independent gallery node?

If the answer is yes, then it would seem reasonable to try to solve the issues with using multi-imagefield fields in a gallery node.

Given that you have the limitation of just Title and Description (which is unavailable to Views) and that it can get tricky having multiple users editing a single node (which contains all of the gallery's images), it occurred to me that the multi-image solution might be a better fit for a sight looking for a user gallery (single user creating and editing) which requires no more than a title for each image (commenting, rating, setting a flag only available at the gallery level). This seems a better road to follow for multi-user site-wide gallery (as long as the performance differential is not substantial). My major concern is the data integrity between the gallery and image nodes.

If you were to have a Taxonomy Vocabulary of 'Gallery' set up for only your Gallery Image content type set up as a multi-level heirarchy (keeping compatablility with pathauto), then you can use the taxonomy list view to navigate your galleries.

As far as trying to eliminate the custom paging, there was a great gallery tutorial using multiple imagefields, creating a page view and hiding the imagefield, creating a block view which displays 1 image at a time with a pager set as an attachment view to the page view. There's got to be some way to incorporate something like this with showing 5 thumbnails (2 prev, 1 current, 2 next) as requested above.

Don't mean to stir the pot. Just that your video and the comments got me trying to think out of the box again. There are many requirements that are expected of users based upon experiences on other sites (as mentioned above). This is why I think so many of us are spending so much time get the best gallery out of Drupal.

Reply

Kirilius

A very good analysis.

A very good analysis. Performance is critical when it comes to big sites. Here are some other points to consider form fucntionality point of view:

Most of the existing gallery modules and tutorials are focused on sites, where the content is provided by a single super-user (or a gorup of super-users/editors). They usually cut some corners in usability because the presumption is that the site admin can put up with not very user-friendly interface. Very few tutorials (like the one above) and modules exist that support building galleries where the user community is contributing content. The perfect example is Picasa. The folks at Google don't upload pictures to Picasa. They have only built a smart framework, that allows their users to manage their own galleries. Of course, sites like that require more user-friendly features. That said, here is my wish list for a complete gallery solution in Drupal. In brackets I have added some comments whether it is better done with multi-imagefield or using node-per-image:
- Multiple galleries per user (easily done by either multi-imagefield or using this tutorial)
- Users have full control on their galleries - create, delete, edit (supported by both methods, although editing a multi-imagefield node that has 100 images in it can be frustrating)
- Users can upload images to their galleries - one by one or bulk (there is a module that allows multiple images to be uploaded to a multi-value imagefield, bit no such thing for image-per-node)
- Users have full and EASY control on their images (both methods allow for this, however the multi-imagefield interface is not very friendly for managing a LARGE number of images. Image re-ordering within a gallery can be very challenging in both methods. Node Hierarchy module provides such functionality but lacks some other features and hasn't been maintained recently)
- Referential integrity - NO ORPHANED IMAGES! (This is automatically handled by multi-imagefield and completely ignored in ALL image-per-node modules and tutorials I have seen. I tried raising the issue in the CCK issues discussions and got a reply thay CCK was not in the business of taking care of referential integrity)
- Ability to geotag a gallery (easily done in both methods usung GMap and Location)
- Ability to geotag individual images (not possible using multi-imagefield as Location molule works only on nodes)
- Ability to easily insert a gallery image in a text. Typically a user would have not only galleries but also the ability to write text contents like blogs, forum posts, comments, etc. An important feature would be to allow this user to use an image, that's already in a gallery and insert in (inline) in some text. (The closest to this I have seen so far is Image Assist module, but it works only with the original Image module and support for ImageField is not there yet)

In short I would love to see a tutorial called "How to build Picasa with Drupal" ;-)

Reply

wingflap

multi-image vs 1 image per node

After some more thought, orphaned image nodes is an issue beyond deletion of the parent gallery node. If you unpublish the gallery node, the node images associated with the gallery node obviously won't show up in the view, but a search will find the image node. In order to unpublish a gallery, you'd have to unpublish the gallery and all associated image nodes.

Additionally, if you use the node access module, it would be possible to create a similar scenario if you restrict access to the gallery node but not to all of the images.

In the issues list for CCK, referential integrity is passed off to the core team. Referential integrity is stated to not be the responsibility of CCK but of the core and until the core handles it, CCK won't be able to enforce it. I have a funny feeling that given the two scenarios beyond deltion that just popped into my head, there are probably other complex issues to contend with as well.

This leaves me still at the point where I like this gallery for a site-wide gallery with many users contributing to a single gallery and a multi-image gallery node for a user gallery.

My work-around for the limitations based on the lack of referential integrity would be simply additional maintenance steps. I'm going to try to create a couple of views. The first to list all image nodes grouped by gallery with a relationship defined as joining on gallery id just showing records with a null gallery (orphaned images). This would be a view available to an admin. Aside from opening and editing each resulting node and re-assigning a gallery, it would be nice to be able to have some bulk operation to select a gallery from a dropdown and check off images that would belong in that gallery and update them in one click. A similar view could be created for unpublished galleries with published images.

Reply

Kirilius

Alternatively actions may be

Alternatively actions may be created/configured so that when the parent is deleted/unpublished, the children are deleted/unpublished as well. I know the method is available, but I am not a Drupal developer and I don't know how difficult it could be.

Reply

Anonymous

gallery thumbnail link

Hi,

I have been trying everything to get the thumbnail to link to the gallery page (one with multiple thumbnails). I can sudo this via "Output this field as a link" on the thumbnail and using the %1 how ever. Once one starts having spaces and what not in the names of the images, everything starting going a bit wonky...

anyone have some ideas for this sort of situation?

Thanks,
Lathan

Reply

yulia

Thank you!

Thanks so much!

I think this is exactly what I've been looking for. I have a content type "articles" and then content "images" and I've been hitting my head against the wall trying to figure out how to link them. All images noderef the content. I'm gonna be trying your method tonight to get the pictures to display as a gallery under the articles...

Reply

yulia

no "return path" option

Ok, Now I'm trying to follow along with the tutorial. I have drupal 6 and installed Reference URL and Views Attach modules.

When I look at Reference URL options, they are not the same as in your video. There is no "return path" drop down option... Am I missing something?

Reply

Anonymous

First congratulations for

First congratulations for the nice tutorial. I have only two questions. What do I have to do if I want that user can only upload photos in their own gallery but not in the other users gallery and second how can I limit the amount of galleries user can create. Thanks

Reply

wingflap

You can set the permissions

You can set the permissions for the gallery and images content types to allow registered users to be able to edit (and/or delete) their own but don't allow them to edit (and/or delete) all.

I'm not sure how you would easily limit the number of gallery nodes a user can create. Nor am I sure how you would limit the number of image nodes a user can create per gallery.

Reply

mufty

printing output

hi, great tutorial. everything works fine.
But it works only when I print whole content (print $content).
How can I print this out if I use my own node template? (I print every signle field there - with special format).

Reply

Anonymous

No images show in my gallery any idea what I'm doing wrong?

Great tutorial, Thanks. I've followed the instructions and images upload fine with the 'add image' link to the site but I don't see them when I go to the gallery. I thought I must have made a mistake so deleted my views and imported your exports, but still the same problem. I sure it's something really stupid but I just can't work it out. Any ideas?

Reply

erin clerico

I have the same trouble -

Upload one or images to the gallery - but they do not show until I flush the site caches.

I'm a Drupal newbie, so I'm thinking I am missing something completely obvious.

Nice screencast BTW - lots of re-usable knowledge - thank you!

Reply

Durruti

Images do not show up in the view with the Gallery argument

I've created the content types, imported the views, installed the latest dev version of view_attach and patched nodereference_url. But I don't see images in gallery view (either teaser or full view), if I remove the 'Argument: Content: Gallery' everything appears but obviously everything appears, so not much good to me. Is it to do with my gallery content type, I set it up exactly as appears in the video.
Many thanks for any suggestions.
Durruti

Reply

mike

Is required necessary?

Hi Jeff,

thanks for this nice tutorial, it came in very handy and it works fine on my site.
But a small question is remaining:
I wanted to have the possibility to have the photos not always attached to a gallery because I have a additional taxonomy for them. So I disabled the "required" in the gallery field of the photo. It still works and I can have independent photos now, but every time running cron I get the following error message:

Field field_gallery was not created for photo because a conflict was detected for the following properties: required

So it seems I missed something, but what?
With this setup it is not possible to alter the gallery an image was posted into, if I click on edit on the photo page, the gallery is printed but not editable, how could I change this?

Cheers
mike

Reply

Anonymous

Can this be made optionally lightweight and for "per user" use ?

Hi! We were having a gallery related discussion in drupal.org at http://drupal.org/node/503796

We had talks on Acidfree for Drupal 6x http://drupal.org/node/371424 which provides
- per user multiple galleries
- nice pagination using both serial image/node numbers and prev-next links
- users can upload or mass import
and also, if site admin needs he can
- extend the image node by any CCK field, except imagefield
- normal or html posting of text content like blog post

Acidfree has the advantage that it is lightweight and ready to run with just core Drupal + Image module. You need to look after only one module. Disadvantage is that no one knows whether it will be available for Drupal 7.

In comparison "Photo galleries with Views Attach" seems to need CCK, Imagefield, ImageAPI, Imagecache, Views .... a plethora of modules increasing the footprint and resource consumption. Several modules will also mean the site admin has to maintain multple modules.

I will like to know if "Photo galleries with Views Attach" can be made optionally lightweight and have the features of Acidfree.

Reply

Anonymous

Can this be made optionally lightweight and for "per user" use ?

Hi! We were having a gallery related discussion in drupal.org at http://drupal.org/node/503796

We had talks on Acidfree for Drupal 6x http://drupal.org/node/371424 which provides
- per user multiple galleries
- nice pagination using both serial image/node numbers and prev-next links
- users can upload or mass import
and also, if site admin needs he can
- extend the image node by any CCK field, except imagefield
- normal or html posting of text content like blog post

Acidfree has the advantage that it is lightweight and ready to run with just core Drupal + Image module. You need to look after only one module. Disadvantage is that no one knows whether it will be available for Drupal 7.

In comparison "Photo galleries with Views Attach" seems to need CCK, Imagefield, ImageAPI, Imagecache, Views .... a plethora of modules increasing the footprint and resource consumption. Several modules will also mean the site admin has to maintain multple modules.

I will like to know if "Photo galleries with Views Attach" can be made optionally lightweight and have the features of Acidfree.

Reply

JT

How do you create a page that lists thumbs of all galleries?

I got evertthing working, but I can't seem to figure out how to build a grid page of all galleries with thumbnails of the latest images in each gallery? I tried creating a page view, but no images show up. I see they show up on the front page, but how do I create that teaser view of all galleries?

thanks

Reply

Anonymous

thumbs of all galleries

JT, this task is also on my desk, i have been trying to achieve this since i first read this tutorial. With an overview of galleries showing the latest image in each gallery this tutorial is complete. I try to achieve this in views using fields, please let me know if you solve this!

Reply

JT

Eaton, can you help us out on this!

You got is this far and now we're stuck! hehe, but seriously would be great to have a thumbnail gallery overview page(s). Would really make this a viable gallery solution.

Thanks!

Reply

JT

Eaton, can you help us out on this!

You got is this far and now we're stuck! hehe, but seriously would be great to have a thumbnail gallery overview page(s). Would really make this a viable gallery solution.

Thanks!

Reply

JT

Eaton, can you help us out on this!

You got is this far and now we're stuck! hehe, but seriously would be great to have a thumbnail gallery overview page(s). Would really make this a viable gallery solution.

Thanks!

Reply

mike

gallery overview page

it seems views attach has a problem when used with fields, so when you try to display the teasers of the galleries in a field of a view to get that overview page, the attached view doesn't show up... but if you build your overview page with nodes in teaser mode instead of fields it works fine...

greets mike

Reply

keisimone

love this video - how to download it to view at leisure

Hi,

i don't want to come back here everytime and wait for the video to properly load one time.

How can i download it? I have downloaded the last videocast involving the fivestar and voting api.

Please help.

Thanks

Reply

Oddette

nodereference patch.....

I've been working with Drupal for about a week now and wanted a slick gallery option, so when I saw this video I thought it was perfect. I followed the instructions and got everything except the return path done. I've looked at the patching instructions and quite frankly it's beyond my skill set ;)

Any idea what the timeline is going to be on getting a new release for the nodereference module? I'm trying to decide whether I need to find another solution or if we can wait it out....

Thanks

Reply

Danny_Joris

Features - Views Gallery Error !! ...

Hi All,

I followed this tutorial until the Views Gallery setup. I'm absolutely stuck with this. I installed Features and Views Gallery, but it messes my Drupal install up. I have Views Gallery installed, but i can't get it working. In the attachment in this post, you see the Features admin menu. If I just click 'view', it will give the error that you can see underneath it. On top of that, i cannot uninstall Views Gallery, because it is set to 'enabled' but it disappeared from my modules list. And I cannot uninstall Features, because Views Gallery needs to be uninstalled first, but that is impossible. Ok, Features is an Alpha version, but Features is required by Views Gallery. How do the rest of you built the Image Gallery in this video tutorial then?

features_error.jpg

I really LOVE this gallery sollution. I hope someone knows how to solve my problem here...

Any help is highly appreciated.
Thanks in advance,
Danny

Reply

Danny_Joris

Features - Views Gallery Error !! ...

Hey All,

I followed this tutorial until the Views Gallery setup. I'm absolutely stuck with this. I installed Features and Views Gallery, but it messes my Drupal install up. I have Views Gallery installed, but i can't get it working. In the attachment in this post, you see the Features admin menu. If I just click 'view', it will give the error that you can see underneath it. On top of that, i cannot uninstall Views Gallery, because it is set to 'enabled' but it disappeared from my modules list. And I cannot uninstall Features, because Views Gallery needs to be uninstalled first, but that is impossible. Ok, Features is an Alpha version, but Features is required by Views Gallery. How do the rest of you built the Image Gallery in this video tutorial then?

features_error.jpg

I really LOVE this gallery sollution. I hope someone knows how to solve my problem here...

Any help is highly appreciated.
Thanks in advance,
Danny

Reply

Danny_Joris

Sorry for the double

Sorry for the double post.

Anyway, this setup ruined my Drupal installation. I want to get rid of Views Gallery, but it is not included in my modules list.

Jeff, why did u make a videocast with an Alpha module? This image gallery was suppost to be the last addition to my website, but now I'm completely stuck!! Please help me out of this again, Jeff... I'm getting pretty desperate here...

Reply

Danny_Joris

I didn't have the 'Full

I didn't have the 'Full Gallery' option in Views at 8:30 in the video, so i thought that was because i hadn't installed 'Views Gallery' yet...

I just deleted Features directly from the server because i did not see another way to delete it. I did this and now Features is gone in my module list and Views Gallery is visible again.

Visible, but still unable to delete it. And in red it asks for the Features module. Is the 'views gallery' not required then for the tutorial? I did never see 'full gallery' as an option in Views. With or without Features.

I am going to keep on asking questions and posting updates until I find a sollution for this, sorry.

Reply

Danny_Joris

Hey Jeff, I finally found

Hey Jeff,

I finally found how Views Attach works and that I need to copy the content of your attachments into the 'import' field in views. I have wasted a day on all of this and my gallery still looks far from yours. This Image Gallery looks awesome, but can you tell next time HOW you built it instead of only showing it? I have been trying to learn Drupal for months now full time and I still get stuck on simple things like building an image gallery. I get stuck AGAIN AND AGAIN. I've wasted my day and this is highly frustrating. I have to learn this full time on my own, while i dont earn a dollar. I don't know how other people here do this. Everybody seems to get this workin right away.

Cheers,
Danny

Reply

Jerrik711

Hard road!

Its been very difficult to find a way to create the perfect gallery!
( where you can actually comment on each image!)

It took me a week or more to finally stumble across this tutorial and the steps to creating what I feel is the perfect gallery!

The only thing missing was the pagers for viewing each image (node)....

It was very difficult to find the answer to adding this feature but I finally got it.

I believe this is something really important to add to this tutorial!

This is how I got it to work! Without using taxonomy!

--------------------------------------------------------------------

1. You have to create a new view just for the image (node)
(I named it custom_pager_images)

2. In the edit view you must set it like this....

- RELATIONSHIPS: content:gallery (I checked "required")

- ARGUMENTS: NodeID

--under validator options
Validator:Node
Type: Gallery

- FIELDS: Node: Type ( remove the text in the text field)
(I believe that you just need to have any field for it to work)

- FILTERS: Node:Published
Node:Type --- Image

- CLICK SAVE!

3. Now we must create the custom pager!

- Go to admin/build/custom_pagers

- click Add a new custom pager

- I named it the same as my view to keep things organized and easy to follow

- select under BY NODE TYPE : Image

- at the bottom select the view we created in the first steps.
- and for VIEW ARGUMENTS I placed this: [field_gallery-nid]
- Click submit!

AND THERE YOU HAVE IT!!!!!!!!

Sorry if its not to clear. I wrote it pretty quick and its my first comment/post ever!

Reply

2ndMile

one addition

Just what I was looking for. A little tweaky (ha) but perfect.

One addition... under arguments: Node: Nid -> options -> relationship, be sure to select the gallery as the relationship.

Thanks again to eaton and Jerrik711

Reply

Gerry

Slideshow within an article

This is not really related:

I am trying to create a slideshow that will behave like and image, where text can flow around it and yet behave like a slideshow. The example below allows a user to view a slideshow without leaving the page.

http://tinyurl.com/mf62fl

Any idea how I can achieve this?

Reply

Gerry

Slideshow within an article

This is not really related:

I am trying to create a slideshow that will behave like and image, where text can flow around it and yet behave like a slideshow. The example below allows a user to view a slideshow without leaving the page.

http://tinyurl.com/mf62fl

Any idea how I can achieve this?

Reply

Anonymous

table caching prevents images from showing up

Same problem as reported by another user: everything works fine, but I won't see any new image until I manually flush the cache tables. I tried to set caching to 0 sec/0 sec in the gallery view, tried also to disable view caching (in admin/build/views/tools/basic), no way... Any suggestion? thank you.

Reply

Jeff Eaton

Known bug!

That's a known bug in the 2.6 version of Views -- using the dev version will correct that. 2.7 should have that fix!

Reply

Joe

Videocasts not Playable on iPhone/iPod

Hello,

I really appreciate the video and audiocasts you guys do. I think there is one problem though. I download the Lullabot Videocast via iTunes and was expecting it to be playable on my iPhone, but to my dismay, it does not. It would be great if you guys could compress the videos in an iPhone compatible format. And to tell you the truth, the compression is not that straight-forward. To save you some time, you can use:

  • Handbrake - free. By default, high quality video at high filesize.
  • ffMPEGx - shareware ($15). By default, medium quality video at medium filesize.
  • MPEG Streamclip - free. Acutally, I don't recommend this one because by default, high quality video at higher-than-original filesize.

Those 3 apps have presets for the iPhone/iPod that allow you to take any video and export it as a compatible format.

I use AVIDemux (free). It makes the lowest quality video (not unacceptable though) at the lowest filesize, using the following settings (no presets).

  • Set Video encoder for MPEG-4 AVC (x264) and Configure the following:
    • Under Motion, set Partition Decision to 4
    • Under Misc, uncheck CABAC
    • Under Partitions & Frames, uncheck 8x8 Transform
    • Under Partitions & Frames » B-Frames, set Max Consecutive to 0
    • Hit ok
  • Add a video Filter
    • Double-click to add a MPlayer Resize filter
    • Change the Resize Dimensions to Width: 480, Height: 320 (uncheck Lock Aspect Ratio, if necessary)
  • Set Audio encoder to AAC (FAAC)
  • Set Format to MP4
  • Finally, Save Video... with extension of .mp4 (I think .m4v will work as well)

Hope this helps and thanks again.

Joe

Reply

Rene

Noderefrence field won't populate with gallery names

Wondering if anyone can help, am trying to debug a gallery that has been set-up by another designer.

Everything seems to work but in the photo content type the node reffrence field that lists the available gallery has no values in it. I tried creating another one with the same parameters as listed in the video and it works fine but is the wrong filed name obviously.

Also I have create another photo upload content type and the node reffrence has the same problem it wont display the available gallerys. However when I create a second one it does work.

Does anyone have any idea about what is happening here?

Reply

Gilles

new page with list of teaser with view

Hello

Thanks for this great stuuuuuuf, it's a succes!

But I want learn more!

After creation of my full gallery and my latest image (for the teaser of each gallery)
I want add a page named "galleries" wich have to display each teaser in a list!

My problem is that i have created 2 galleries with 3 images per gallery (so 2 teasers)
but in my page "galleries" i display 6 teasers with each image per teaser and not 2!!!

name = galleries
Html List
item to display : 3
path : galleries

relationship :none

arguments :
none

fields :
content gallery : teaser
---

What's the issue...???
Kind regards!

Reply

Jerrik711

Items to Display

Did you try changing Items to Display to 1 instead of 3?

Reply

Igal

show content from gallery content type

You probably showing contents from content type "Photo". You have to show content from content type "Gallery". Filter your view to Gallery content type, change "Row type" to "Node" and set "Build mode" as Teaser.

Reply

Matt Fawcett

Creating an overview or listing page for all your galleries.

Thanks Jeff for this great tutorial!
I just wanted to respond to the many people that have been requesting a way to create an overview or gallery listing page. I've attached my exported view below but basically as with any view where you want to the use the teasers as styled on the front page, you need to set your 'row style' to 'node':

Row style: Node -> style settings -> build mode: teaser

Then you can filter the results as you like, in this case we would set the filter to show only nodes of type 'gallery'. Done. Views is powerful but can be tricky to understand.

One thing that is still troubling me however is how to set the 'Latest image' to link to the gallery rather itself? Custom links? Any advice?

Cheers all, great video and interesting comments too!
Matt

$view = new view;
$view->name = 'galleries_listing';
$view->description = 'A page view displaying teasers of all existing galleries.';
$view->tag = '';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Gallery page (list of galleries)', 'default');
$handler->override_option('filters', array(
  'type' => array(
    'operator' => 'in',
    'value' => array(
      'gallery' => 'gallery',
    ),
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'type',
    'table' => 'node',
    'field' => 'type',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
));
$handler->override_option('access', array(
  'type' => 'none',
));
$handler->override_option('cache', array(
  'type' => 'none',
));
$handler->override_option('title', 'Photo Galleries');
$handler->override_option('row_plugin', 'node');
$handler->override_option('row_options', array(
  'relationship' => 'none',
  'build_mode' => 'teaser',
  'links' => 1,
  'comments' => 0,
));
$handler = $view->new_display('page', 'Page', 'page_1');
$handler->override_option('path', 'galleries');
$handler->override_option('menu', array(
  'type' => 'normal',
  'title' => 'Galleries',
  'description' => 'Photo Galleries',
  'weight' => '0',
  'name' => 'primary-links',
));
$handler->override_option('tab_options', array(
  'type' => 'none',
  'title' => '',
  'description' => '',
  'weight' => 0,
));
Reply

daniel

CSS for galleries

could somebody help me to display the overview of galleries like the author made it in the tutorial video?

Reply

Yan Yan

Thanks

Thanks! you are great, I import your code, it work wells....Thanks TONS....

Reply

sidenwder

Problems with Updated files

Hey Jeff,

Thanks for the great tutorial.

I thought I would have a go importing this feature into open atrium. The feature imports fine and can be activated in a group. However, when I could not see the feature I noted that there was no views that had come in with the feature. No problem I thought, so I thought I would import the view from the file you also provided. It will not import and gives and error message:

* Display plugin node_content is not available.
* Display plugin node_content is not available.
* Unable to import view.

Additionally, the gallery content type text file you attached is an empty file.

Has anyone successfully incorporated this feature into open atrium? Would be nice if it could work.

Cheers S.

Reply

Sidewnder

and more...

Well I'm a idiot - the error was from not having the views attach module enabled - Doh!

I managed to get the Feature working in Open Atrium but had to create a Galleries unformatted page node view to have a menu item for the Feature. CSS injector seem to be incompatible with context module in OA which meant that the CSS will have to be applied some other way.

This would be a nice feature to get working in OA as it could be used to reference photographs to other group nodes and effectively gives each group their own galleries. Once Development Seed get their Features server infrastructure rolling, I hope to see some other examples.

Thanks Jeff... S.

Reply

JG

Teaser Links

Fantastic modules and screencast, it saved me a lot of trouble.
I used a rewrite output, something like
<a href=/node/%1>[field_foto_fid]</a>
on the teaser views, and it worked!

Thanks a lot.

Reply

bensemmel

Link from Teaser

for me the rewrite of output of the imagefiled with %1 didn't work, but with !1 it worked out perfectly.

' [field_image_fid] '

And thank you for the tutorial....

Reply

Miriam

Teaser links step-by-step

Thanks for the tip. For anyone else out there trying to link from your Galleries overview page to an individual Gallery page, here are the steps:

1. Edit the gallery view.
2. Select the Latest image display on the left.
3. In the Fields section select Content: Image short image
4. Select the Output this field as a link option
5. In the Link path field type %1 (if you are using pathauto for automatic url aliases this might be slightly different. For example I used gallery/%1)
6. Click Update, and Save your view.

Reply

Miriam

Not working 100%

Sorry, I spoke too soon. The above only works if you have a simple, one word title for your gallery, in which case the pathauto alias will be the same as the gallery title.

So I still need a full solution. I could override the theme template and do some string replacements but that's not very elegant. Is there a better way?

Reply

Pinguin

Teaser links step-by-step

Thanks for all your work,

I followed the screencast step by step. And also should have done everything right. the only thing I I don't know how to get the "gallery overview page" displayed? Actually this is missing in the screen cast as well - dont you think?

I also did how you describe here steps 1-6 without success. So hm I can not end the work of today that happy.

p.

Reply

Miriam

Creating the overview page

See the earlier post titled "Creating an overview or listing page for all your galleries" for instructions on how to create an overview page.

Reply

Anonymous

Teaser image linked to gallery

In step 5 above I used link path node/!1 and the teaser image now links to the gallery instead of the node.

I have not yet figured out how to get all teasers to appear on one page instead of on the front page. Has anyone figured that one out?

Reply

Phil Glatz

moving images to different galleries

Great tutorial Jeff, thanks for making it so clear.

I've been trying to figure out how to move an image from one gallery to another, editing the gallery image doesn't bring up a way to select a different gallery, it just displays the gallery name. Is there a way I can substitute a dropdown list of available galleries?

thanks

Reply

Anonymous

using views?

Hi,

Sorry quick question - when i arrive at the views and using Gallery_photos as a title , how do I add the "full gallery" and "latest images" under the display. Is this a feature of Gallery Attach?Sorry im completely new to all this and have trying to follow some tutorials...would greatly appreciate any help!! :)

Reply

Max

??? ????????

??? ???????? ???? ? ??????? ???????????? ?????? ?????????, ???????? ?? ????????????. ? ??? ????? ???? ????????

At creation of photo headings are represented in galleries only, pictures are not represented. What a problem can be in...

I am sorry, i am not very write and speak English...

Reply

Danny_Joris

_

Hey Jeff,

I fixed all my troubles I had before with this tutorial. It had something to do with the Features Module. I described this in this issue for the Features Module: http://drupal.org/node/511552 .

I still have one little thing that I would like to solve though. It about the replacement patterns in Views. I want the teaser image for the image album to link to my image album, but there are only a few options available for tokens. I can't link to my albums like this. I would love to use the same Tokens I used to specify the url of the galleries for. The forum topic can be found here: http://drupal.org/node/518808

Thanks in advance!
Cheers,
Danny

Reply

budda

Call to undefined function imagefield_widget_settings_save()

Activating the feature gave me a delightful PHP error:

Call to undefined function imagefield_widget_settings_save() in /var/www/html/drupal-6/sites/all/modules/imagefield/imagefield.module on line 154

Not blaming Views_Gallery feature, but the features system lacks minimum version numbers or something for dependancies (like Drupal does really)... so beware if you get a WSOD!

Reply

budda

Features module need more work

Upgrading to 3.1 of the imagefield resolved this, but then left me with Fatal error: Call to undefined function context_enabled_contexts() in /var/www/html/drupal-6/sites/all/modules/features/includes/features.context.inc on line 43

I don't think Features.module is very stable :-/

Reply

Ginko

Node Referencing already existing nodes in a gallery

Hi Jeff,

I've created my gallery node type following your tutorial and it works great!

But I wonder how to enable users to reference already existing image nodes into a gallery.

This is possible if (as I done) you have made the node reference field optional in the image node type. But users have to find and edit each image node in order to do this.

Is there a solution to "reverse the process"? E.g. insert a link next to the "Add Photo" link in each gallery which let user browse and select image nodes he wants to add in the gallery.

Thanks in advance and sorry for my possible mistakes (English isn't my native language).

Reply

thamas

Workaround to linked thumbnails in gallery listing

It's not so elegant and adds a bit extra work when you create your galleries, but it adds more freedom too and still needs no programming.

So, instead of creating the Latest image view, add an image field to your gallery node type. Add your images to the gallery, and when you are done, edit the gallery node, and using the FileField Sources module (http://drupal.org/project/filefield_sources) choose the image you want to be the gallery thumbnail.

(And if you do so, you can use fileds in your gallery view instead of teaser.)

Reply

Miriam

Linking thumbnails to gallery instead of to image

I've finally come up with a way to link the thumbnails in the Gallery overview page to the gallery node instead of to the image node. It's very tweaky and involves some coding so may not be suitable for everyone.

1. I use pathauto to create automated gallery and image urls. This is important as I'll be using this information to replace the image url with the gallery url in my code. Gallery urls have the pattern gallery/[title-raw] and image urls have the pattern gallery/[field_gallery-title-raw]/[title-raw].

2. Edit the gallery view and change the Row style of the Latest image display from Fields to Node. Now the full teaser will be displayed in the Gallery overview page instead of just the thumbnail.

3. Edit the display settings for the teaser at yoursite.com/admin/content/node-type/image/display. For the Teaser, select short image linked to node for the Image display.

4. Create a node-image.tpl.php file in your theme so that you can strip out the teaser fields you don't want displayed, and just leave the thumbnail image. To do this make a copy of node.tpl.php and rename it.

5. We only want to change the teaser view, so you can add code to the top of node-image.tpl.php to handle just the teaser, and leave the rest of the file as it is. I added the following code:

<?php if ($teaser): ?>
  <?php
   
// get the url of the gallery overview page by stripping off the image part of the node_url, i.e. remove everything after the 3rd forward slash
   
$gallery_url = substr($node_url, 0, strposnth($node_url, '/', 3));
   
// Replace the node_url with the gallery url you've just created
   
$img_markup = str_replace($node_url, $gallery_url, $node->field_gallery_image[0][view]);
   
// display the image
   
print $img_markup;
  
?>

<?php else: ?> .... the rest of the file remains the same

6. The strposnth() function used above is as follows:

/**
* just like strpos, but it returns the position of the nth instance of the needle
*/
function strposnth($haystack, $needle, $nth = 1)
{
  // Fixes a null return if the position is at the beginning of input
  // It also changes all input to that of a string ^.~
  $haystack = ' '.$haystack;
  if (!strpos($haystack, $needle))
    return false;
  $offset=0;
  for($i = 1; $i < $nth; $i++)
    $offset = strpos($haystack, $needle, $offset) + 1;
  return strpos($haystack, $needle, $offset) - 1;
}

7. Clear your cache and everything should work just fine. You may need to change your css to beautify the new markup.

This is very convoluted and I'm sure there has to be an easier way to do this, so please share if you have a better solution.

Reply

Bernardine

Views Gallery with Thickbox?

Have everything working great with this. Would really like to make it work with Thickbox, to launch from a thumbnail click on the gallery view page. Is it possible?

Reply

Matt Fawcett

Can't see why not, I use it with lightbox2 and it's pretty good

Hi Bernardine,
It's just a case of changing the "Format" option at the bottom of "Content: Image" field. It should read something like "Thickbox: gallery_thumbnail -> display box". It should just work from there on in, with thickbox giving you arrows to scroll through all the images on the page.
One thing I haven't yet worked out is how to allow the scroller to go to all images in the gallery rather than just those on the current page (I use a pager you see), but I'll have a look at that later (let me know if you get it worked out).
Thanks again for the tip on linking "latest image" to it's gallery, working brilliantly for me.
Cheers
Matt

Reply

Bernardine

Yes indeed, I finally got it

Yes indeed, I finally got it working yesterday ... I'd tried the Thickbox: [preset] before with no joy (each image was launching solo, 1/1 of it's own node value), but yesterday that plus some combination of other changes worked.

Thickbox's CCK gallery builder options supports a "per field" option which doesn't work with this config tho. So yes, I had to set it to build the gallery out of all the images on a page, which meant getting rid of the gallery pager to include all.

Reply

NeoID

Great tutorial! The only

Great tutorial!
The only thing I don't understand is how the latest_image views work... I've now a set of working galleries with images in them, but how do I get that gallery-index page you have with the latest images? What's the url to the view/page?

Reply

NeoID

Great tutorial! The only

Great tutorial!
The only thing I don't understand is how the latest_image views work... I've now a set of working galleries with images in them, but how do I get that gallery-index page you have with the latest images? What's the url to the view/page?

Reply

Kjetil

Individual image site

I've tried creating this gallery, but the images in my galleries get the wrong link. I've created several galleries, and when I go to them(they have urls like node/10), I get a thumbnail listing of all the photos. They are all links, like put in the view, but the link point to the node with all the photos, so I just go to the node page(node/11) and get a vertical listing of all the photos I've uploaded in that gallery, and not the individual image site.

Does anybody know why this is happening? How do you get the thumbnails to link to the individual images?

Reply

Kjetil

Image fupload

Okey, I solved my problem. I was uploading several photos to one node, which didn't work very well. But batch uploading would be nice. How do you do this with the image fupload module? Isn't it only possible to upload to a single node?

Reply

Bence

Order of views?

Thanks for the greate tutorial, it works very nicely, even with lightbox integration. And I have integrated the function of the gallery content type into my own content type, so along with the fields I require for my content type, I can also display a gallery.
However I have one small problem: the images attached to the content I'm displaying with views is appearing at the TOP instead of the bottom. I tried playing around with the weight of the CCK fields, but they doesn't seem to have any effect (and of course the fields of the images and the fields of my own content type are in a different contenty type).
Any ideas how this can be resolved?
Thanks!

Reply

Eric

Awesome

This is an awesome module and very easy to install. I just can't figure how to make the galleries display on any other page than the home page. I'm sure there's something simple that can be done in Views, I just haven't figured out what it is. Does anybody know the solution?

Reply

Anonymous

I copied Matt Fawcett's view

I copied Matt Fawcett's view above and that did it for me.
The only problem, as has already been indicated, is that the image isn't clickable.

Reply

Oliver Davies

Right... What I did was to

Right...

What I did was to create another standard "Page" display into my photo_gallery view. The changes that I made for this are:

- Changed the Row Style to "Node" and then set it to "Teaser".
- Removed the "Gallery" arguement
- I added an extra "Node: Type" filter to ensure that only the Gallery content type was visible.

I then added a path called "photos" and it worked!

Reply

sasi

hi, thanks a

hi,
thanks a lot.creating a menu link for photogalleries have been night mare for me.but after reading yours its no more.thanks a lot for suggestion.

-sasi

Reply

Anonymous

hmmm

aside from the issue that Eric, above me, posted about how to make the galleries overview page be on something OTHER than the homepage (i need to do this too, once i get this thing working), i have a weird problem.

i cannot for the life of me get the output to actually DISPLAY my images in the gallery. the titles are all there. the descriptions are there. i added some extra fields to photos and THEYRE all there. but not the thumbs.

Reply

hunter

hmmm

okay. so aside from the issues that eric, the guy above me, posted (i also need to be able to have a gallery overview page NOT on the homepage), i have an issue.

i've done this following the tutorial AND installing your feature, and my images just arent showing up in the gallery. the title is there. the date is there, a custom link field i entered is there. but not the thumbnail. what am i dont wrong??

Reply

Arnaud Fischer

User with User Profile?

Jeff, this is great. Thank you so much. I started playing with it and it is promising, a nice short cut to creating galleries as nodes. I have also been trying for days to add a photo gallery to User Profiles using Content Profile to leverage CCK. I have had no luck with Advanced Content Kit and Gallery2 will require more time for me to integrate although I understand gallery2/gallery might be the best solution in the long run.

Question: is there a way to add the Views Gallery to a user profile displaying the cover photo?

1) - I have tried adding a Node reference CCK field to User profile content nodes but I don't seem to be ale to only add the image selected as gallery cover. How should I do that?

2) - I already have an Image content type created by the Image module. I have already uploaded Images to use with the Image Gallery module but I much prefer your setup with Gallery as a content type/node. Should I use your "Gallery Photo" content type or can I use the "Image" content type to create the relationship with gallery?

Thank you for your help; fully appreciated. I have just 2 months of Drupal under my belt ... newbie :-)

-arnaud

Reply

shima

no add photo link

tnx jeff :)
that is really best
i have not add photo link when i create a gallery like movie :(
pls help me

Reply

Mateo

Change the "Add Photo" placing or creating a block

Hi, first of all great tutorial. I'm applying what you teach in the video to other subjects, not only photo galleries. I have only a question. I would like to place the "Add Photo" link at the top of the node at the right, or perhaps even creating a block with the link. How can I achieve this?

Thanks for all
mateo

Reply

Kirilius

Image FUpload integration

I tried this with Image FUpload module and it kinda works but not completely. After I create a number of photo nodes that are linked to a gallery, how should I tell Image FUpload to return back to the gallery that started it?

Reply

Do I need it?

nodereference Error

I used Features but node reference is giving following error
notice: Trying to get property of non-object in ...modules/nodereference_url/nodereference_url.module on line 68.
notice: Undefined variable: object in .../all/modules/nodereference_url/nodereference_url.module on line 68.
Am I doing something wrong?
How can I check where did I go wrong?

Reply

Myers

Thanks Eaton, I downloaded

Thanks Eaton, I downloaded the module it worked. But i wasnt able to configure it with views. I was getting node reference error.
its a great Tutorial. I was wondering to have a dynamic image gallery And this is it.

Regards
Myers

Reply

Kelly Harding

Those errors are because

Those errors are because you've not enabled/installed the CCK modules. Download and install the modules marked as missing and then you'll be able to install views_gallery.

Reply

Jeno

More file format for the gallery

Thanks for the video. Great resource, absolutely love it.

May I know what do I need to do In order to put more contain to the gallery?
I would love to have video, audio, PDF, xls, doc...etc into my gallery. For the document file like pdf, xls and doc it is fine if I can't view it directly without downloading it but as for the video and audio I need the ability to play them on the webpage.

Thanks~

Reply

Jeno

More file format for the gallery

Thanks for the video. Great resource, absolutely love it.

May I know what do I need to do In order to put more contain to the gallery?
I would love to have video, audio, PDF, xls, doc...etc into my gallery. For the document file like pdf, xls and doc it is fine if I can't view it directly without downloading it but as for the video and audio I need the ability to play them on the webpage.

Thanks~

Reply

TSI

Looking also...

I am also looking for a solution for the same problem, I want only user who can edit the gallery node to be able to add photo.

Reply

Daniel

crude way of doing non-shared galleries.

I have been trying to do this exact same thing for a few hours, and i found a half ass way to do it. If you go to your photo_gallery View and change up the arguments you can get Views to filter out everybody else pictures that are posted to that gallery

1.

Go to your photo_gallery View, then the Full gallery View
under Node Content Settings change your arguments to "Use Tokens form the node the view is attached to" and enter "[nid]/[author-uid]" in the textfield. This will pass over the node id and the author's Uid to the view

2.

Under Arguments add a "User:uid" argument set the Validator to "User", and i like to remove the Wildcards unless they are needed. Repeat this for the "Latest Image View"
----------------------------------------

My next step is to filter the Node Reference List in the Photo so that only gallery the user has created show up.

I know this isnt the best way of doing things, but it works for now until i find a better way.

Reply

photocurio

'add photo' button missing

I am new to Drupal, and am setting up a test site (localhost on my mac). I have installed the core an the various modules you have listed for creating galleries. I mostly seems to work, but there is no 'add photo' button when I create a new gallery.

I want the batch upload to work also, and don't see any option for getting that to work.

Reply

wildcats1369

Drag and Drop Uploader

I worked on a Drag and Drop Uploader for Views Galerry.

Somehow I was able to create something like this
http://www.youtube.com/watch?v=-QWPbhxiOMw

This is actually my first Drupal Module Created by editing Imagex ( Image ) to fit in Views Gallery Module ( Imagefield ). As we all know ImageX dont work for views gallery.

This is working but there are still a lot of to clean up so im not yet submitting it.

Features:
Drag and Drop Multiple Uploads ( using postlet )
Images are associated directly to specified gallery
1 node 1 image

Possible Todos
After upload manage to change the name and add descriptions.

Wish me luck

Reply

EdInJapan

Wishing you luck

@wildcats1369

Wow, that looks wonderful! I'll not only wish you luck, but I would be happy to do some testing/documentation for you if that will help. (Please contact me using the contact page over on drupal.org if I can be of help.)
Good Luck!

Reply

wildcats1369

To Those who tried downloading

To those who tried downloading the module and failed
Sorry my mistake i was logged as admin and didn't notice that the file is not accessible to the public.
I made the necessarry changes and it is now available.

Reply

mirowais

How to create a personal galleries

Can we show a galleries which a user has created on node/add/photo. Currently it displays all galleries in a list. My requirement is a user should be able to upload photos only in the galleries created by him.

Reply

LisaB

populate image gallery slideshow

Thank you for a beautiful image gallery. I'm trying to link the grid view to a slideshow view that is populated with just the images from the gallery I'm viewing. How do I limit the images to just those of one gallery? I tried duplicating the gallery view, and changing it from grid to slideshow, but then I just show both the grid and the slideshow. I'd like to have a link to a slideshow, that is limited to just the images of the gallery I'm in.

If I create a page view for the slideshow, and put node/% as the url, then the first page image links to the slideshow of just that galleries, images, but I can no longer see the grid view.

Any words of wisdom?

Thanks!

Reply

patdunlavey

Behavior in organic groups

Is there any way, when adding a photo, to restrict the destination galleries (nodereference_url list) to those in the current organic group? I'm using og to allow a school to have separate sections of the site for each class. However, with this feature, teachers can contribute their photos to any other class's galleries.

I found no issues regarding organic groups on the nodereference_url issues queue.

Reply

sasi

hi jeffy, its

hi jeffy,
its really awesome tutorial. great work.

Reply

Adam

Hello! This setup would

Hello!

This setup would really help us fill a need for the users we support, especially bundled as a Feature. However, I've tried getting this set up in several different ways (following the tutorial step by step, installing views_gallery, installing the feature from R. J. Steinert's server), and every time I run into the same problem.

When I open up the view, the "Arguments" block lists the following error message:

"Error: handler for node_data_field_gallery > field_gallery_nid doesn't exist!"

Ultimately this means that when I view a particular gallery, the attached view includes photos from _all_ galleries, rather than just the one I'm looking at.

Has anybody else run across this problem?

Otherwise, I really appreciate the work you've put into this; as I said before, it will really be a useful addition for our users once I've got this problem fixed.

Thanks!
Adam

Reply

Anonymous

Question

Hello:

Great tutorial, I implemented and its quite useful. I want to get the same list of galleries with the most recent image thumbnail, but not in my frontpage, since I have some other stuff there. I tried creating a new view which will display the node: teaser of my content type gallery, but it just displays the description, I can't get the latest thumbnail added to this teaser in my view. I am doing it the wrong way? How can I get the exact view in my frontpage (of all the galleries) but in a different page than my front page?

Thanks

Reply

Anonymous

Question

Hello:

Great tutorial, I implemented and its quite useful. I want to get the same list of galleries with the most recent image thumbnail, but not in my frontpage, since I have some other stuff there. I tried creating a new view which will display the node: teaser of my content type gallery, but it just displays the description, I can't get the latest thumbnail added to this teaser in my view. I am doing it the wrong way? How can I get the exact view in my frontpage (of all the galleries) but in a different page than my front page?

Thanks

Reply

Anonymous

Found a solution

Hello:

I already found a solution with views attached. I add a display view which attaches the latest picture of the gallery, but thanks any way.

Reply

Mariusz

CSS doesn't work for one image next to text in teaser view

hi,

this part of css:

div.view-display-id-node_content_2 {
float: left;
padding-right: 10px;
}

div.view-display-id-node_content_2 div.view-empty {
border: 1px solid black;
font-size: 0.9em;
padding: 5px;
text-align: center;
width: 140px;
}

doesnt work for me on garland theme, image is on the left below the texn, not next to the tehx on the left side,
anybody know why ? and how to fix this ?

Reply

eM.

Double that

I have the same issue. The float doesn't work because the image is below the paragraph. The solution is probably simple but I haven't figured it out yet. Any ideas?

Reply

Jena

trouble on the server

This gallery is perfect and wonderful on my local installation, but when I moved the site to the server I am getting an error for the imageAPI module:

Parse error: syntax error, unexpected T_ARRAY, expecting '&' or T_VARIABLE or T_CONST in
/home/mysite/mysite.com/sites/all/modules/imageapi/imageapi.module on line 161

My host server runs PHP5 in CGI mode, could that have something to do with it?

Will the gallery run without imageAPI?

Hope this isn't too off subject. Thanks.

Reply

Jena

my host misinformed me.

I figured out the issue. My host told me the server was running PHP5, but when I ran a phpinfo() script, it turns out they are using php 4.4.9. ImageAPI will only run on php5. So there it is.

Thanks anyway!

Reply

Anonymous

Gallery of galleries

I noticed a number of people asked about this - getting the teaser list of all galleries on a separate node page. It took me a little while to get this working and I still consider it a bit of a hack but I'm also still new to drupal.
My solution is to create a new view which I based on the "image galleries" view. I also wanted the gallery teaser image to be clickable into the gallery and not the node so I created a custom template for that. It affects all nodes though (which I don't care about since I'm using lightbox). It looks like there's a way to get the template to only affect the teaser view but I couldn't quite figure it out (just template naming convention?)
Anyway, if you're using the latest views_gallery module then this should be pretty easy.

1) add the "Content: Gallery Full node" node reference field to "Last Image" teaser. Exclude it from display (we need this to get the nid of the gallery).
2) import the "galleries" view

$view = new view;
$view->name = 'galleries';
$view->description = 'The default gallery of gallery nodes';
$view->tag = 'galleries';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('fields', array(
  'title' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
    ),
    'link_to_node' => 1,
    'exclude' => 0,
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
    'relationship' => 'none',
  ),
  'teaser' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'exclude' => 0,
    'id' => 'teaser',
    'table' => 'node_revisions',
    'field' => 'teaser',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
));
$handler->override_option('sorts', array(
  'title' => array(
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
  ),
  'changed' => array(
    'order' => 'DESC',
    'granularity' => 'second',
    'id' => 'changed',
    'table' => 'node',
    'field' => 'changed',
    'relationship' => 'none',
  ),
  'changed_1' => array(
    'order' => 'ASC',
    'granularity' => 'minute',
    'id' => 'changed_1',
    'table' => 'node',
    'field' => 'changed',
    'relationship' => 'none',
  ),
));
$handler->override_option('filters', array(
  'type' => array(
    'operator' => 'in',
    'value' => array(
      'gallery' => 'gallery',
    ),
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'type',
    'table' => 'node',
    'field' => 'type',
    'relationship' => 'none',
    'override' => array(
      'button' => 'Override',
    ),
  ),
));
$handler->override_option('access', array(
  'type' => 'none',
));
$handler->override_option('cache', array(
  'type' => 'none',
));
$handler->override_option('empty', 'There are no images in this gallery.');
$handler->override_option('empty_format', '1');
$handler->override_option('use_ajax', TRUE);
$handler->override_option('items_per_page', 6);
$handler->override_option('use_pager', '1');
$handler->override_option('style_plugin', 'grid');
$handler->override_option('style_options', array(
  'columns' => '3',
  'alignment' => 'horizontal',
));
$handler->override_option('row_plugin', 'node');
$handler->override_option('row_options', array(
  'relationship' => 'none',
  'build_mode' => 'teaser',
  'links' => 1,
  'comments' => 0,
));
$handler = $view->new_display('image_gallery', 'Gallery page', 'image_gallery_1');
$handler->override_option('path', 'pictures');
$handler->override_option('menu', array(
  'type' => 'tab',
  'title' => 'Pictures',
  'description' => '',
  'weight' => '0',
  'name' => 'primary-links',
));
$handler->override_option('tab_options', array(
  'type' => 'none',
  'title' => '',
  'description' => '',
  'weight' => 0,
));

3) create your view field template in your theme dir:
views-view-field--gallery--field-gallery-image-fid.tpl.php with content:
<?php
    $gnid
= $row->node_data_field_gallery_field_gallery_nid;
   
$galias = drupal_get_path_alias("node/$gnid");
    print
"<a href="http://www.lullabot.com/%3C/span%3E%3Cspan%20style%3D"color: #0000BB">$galias">$output</a>";
?>

I tried using the "l" link function but that didn't work for me.

Reply

Anonymous

No image show up, but i see thumbnail when uploading

Greetings All,

This is a grand luxe tutorial, but one thing doesn't work out for me.

I started with a clean drupal and only installed the files needed for this tutorial.
Downloaded the zips & got it to work.

I can upload images, i see them on my ftp
and i see a thumbnail appearing when i upload in the drupal form.

but when i want to see the gallery where i posted it in, i see no image.

Can any one help me out? i am very new to this . Thanks

Reply

Anonymous

I had the same Problem. Than

I had the same Problem. Than I thought "let's see the imagecache setting" ... and after just enabling imagecache_ui it started to work.

Reply

Dermot

Thanks for the screencast!

Thanks for the screencast - very helpful!

Many people who run photo galleries are photographers by trade, but photo blogging is also very popular among hobbyists and amateur shutterbugs.

To be certain, a lot of the most popular photo galleries have gained attention because the pictures on them are of the highest artistic caliber, and a lot of the people who run these striking Drupal photo galleries are graduates of prestigious art schools and have impressive professional portfolios. However, some of the most well known and most often visited photo blogs are as notable for their concepts as for the pictures themselves.

Certain photo galleries, like the popular "Cute Overload" which features picture after picture of adorable animals, are more about the thematic content of the pictures than they are about the style in which the snapshots are taken.

Thanks,
Dermot
http://HomeInsuranceMatters.com

Reply

Rex Vane

Thanks for this demo

I'm a professional photographer just trying to get to grips with Drupal as a platform for my gallery. This demonstration was very informative - and this thread has opened my eyes to many considerations that I had not previously entertained.
If (when) I'm successful with my own gallery I've been asked to produce one for a local business who provide bushcraft courses to children so your easy-to-follow tutorial is greatly appreciated.

Reply

littleoracle

Awesome and working, except for the images...

everything is working. i can see the galleries, can see the titles and upload info of the images in the gallery, but the images themselves aren't showing up! anyone have any suggestions?

and yes, i've flushed the cache.

Reply

Brian

RE: Gallery of galleries

I have the latest views_gallery module installed and working, and want to build the list of galleries view. However, your instruction: 1) add the "Content: Gallery Full node" node reference field to "Last Image" teaser - does not make any sense. The install of the views_gallery does not build the last image display.

Can I also get the "For Dummies" version of: 3) create your view field template in your theme dir:
views-view-field--gallery--field-gallery-image-fid.tpl.php with content:

Thanks for sharing your code...

Reply

Rosso

Images in block

Nice wat to handle images.
I only have a question because i am afraid i am doing something wrong.

I try to make a block with all images from a gallery to navigate the "main screen" showing just one image.

I tried different ways to create this but all i see is all pictures in a block or no images. I like to filter the content of the block depending on the image in the main screen.

Can you help?

Jeroen

Thnx

Reply

Anonymous

More in depth video tutorial

I downloaded all the modules and followed the video cast and tried to make this gallery work, but was not able to get close. I am just wondering if there is any way you could make a more in depth tutorial from step one to the last step on how you are able to create this pretty sweet gallery. I would really appreciate if you could do that.

I would like to see what it is I am doing wrong and how I can fix it. I think I would have a hard time explaining what I may be doing wrong or having issues with...

Thanks

Reply

Mindaugas

wrap text around image

I wondering how you made text to wrap around that teaser image. That view content with little teaser image appears after and its impossible to float that image to left and make text wrap around. can somebody help me to sort this out.

Reply

nycjomo

Ajaxy Custom Pagers?

Hi Jeff (and others),

In the toot you mention that custom pagers refreshes using ajax. I am using custom pagers on three block views on my homepage but they do not refresh using ajax. They reload the page and in fact if I page to next/prev on one block all the blcoks reload and advance/revert.

Is there something else I should be doing to get custom pagers to utilize ajax? I have ajax module installed and it is working for other parts of the site.

Excellent gallery toot btw.

Thanks!

Reply