0

I’m developing a site in Drupal 7 where users view a calendar of events as well as photos taken at those events.

I’ve already created an Event content type, generated several Event nodes, and put those nodes together in a Calendar view.

What I want to do now is add a ‘Photos’ link to Event nodes. Clicking on this link should open a gallery of photos for the given event. For example, imagine a user is viewing an Event node titled ‘Pool Party @ Jan’s House’. The user clicks on the node’s ‘Photos’ link and then sees a photo gallery also titled ‘Pool Party @ Jan’s House’ that displays all and only photos taken at that event.

How do I get the following two actions to happen (automatically) when an Event node is created?

  1. Make a directory that will contain photos for the event. (These photos will be uploaded later by users who attend the event.)
  2. Include a ‘Photos’ link in the newly created Event node that opens a page display of the directory's files. (See the example I give above.)

I’ve been trying to figure this out using the Media, Rules, and Views modules, but I’m not making much progress.

Thanks in advance for your help.

1 Answer 1

0

Creating directories on the fly in the actual file system is uncharacteristic in Drupal.

The simplest way of attaching photos to nodes would be having an image field with unlimited number of uploadable images. That would show thumbnails of those related images right there when you go to the node page. This is all in core.

If allowing all users to edit event nodes is not an option, you could create an image node type and connect images to respective events with node references or taxonomy, and then create a view listing those images on the node page (views attachment) or on a separate, gallery page.

4
  • Your first suggestion to add an image field to the Event node appears to be working well. In fact, the option to designate a subdirectory for uploaded images gets me close enough to the sort of directory structure I was seeking. I have one question, though. Will users be able to comment on (a) individual images uploaded to the Event node or (b) just the Event node itself? If (b), I think I'll need to go with something more like your second suggestion. Thanks!
    – rsborn
    Commented Aug 14, 2013 at 14:49
  • B, they will be only able to comment on the Event node. Except that of course there is a module for that too... drupal.org/project/field_comments I quickly tested this and sure enough, you can comment every image on an unlimited images field. I don't how good this module is. Commented Aug 14, 2013 at 15:48
  • Thanks for the tip on the module. Any tips on improving the display of the photos? Right now they appear as a single column, regardless of image style (which I believe controls only size, not placement). I've been trying to use a node reference to a view of the photos uploaded to the Event node's image field. I've hidden the image field and have instead displayed a node reference to a view of the photos. Essentially, I'm trying to add photos using your first approach and display them using something like your second approach. Just not sure about the view's filters and relationships.
    – rsborn
    Commented Aug 14, 2013 at 18:26
  • Nope, no tips on the field_comments module as I'm familiar with it other than the quick try. Probably best to cook your own combination using the most popular modules. Commented Aug 14, 2013 at 21:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.