Let’s say I have created a content type called movies and I want all nodes in movies to have a gallery tab. Inside the gallery tab it should allow users to upload images. How can I do this?
1 Answer
The best / simpler way would be to create a second content type called 'image', and give user the permission to create nodes of type 'image'. You can add a CCK imagefield to provide an image upload field.
Then you will want to be able to store relationships between your movie node and the related images nodes. You can add a node reference field on the image content type. You can populate this field by default with the movie reference. So any image added in the website will be related to a movie.
You can then create a view that will list the images related to your movie ID.
-
1The only problem with that is the user inference will be confusing to someone who doesn't know drupal. I wanted to make a easy UI like facebook photos. Any other solutions?– RurikoCommented Jun 20, 2011 at 9:45
-
There are many ways to manipulate the interface and build a better ui. You can add an 'image' node creation form directly in the 'movie' node in view mode : by template : something like print drupal_get_form('form_id'); or by module : add the node creation form in the movie node array before rendering. Otherwise you could use CCK permissions to let user edit the node and add images, but they would have access to other's submissions. I'm not sure there is a straightforward solution for what you want to do, but it seems easier to find a solution based on "standard" modules and then tweek your UI Commented Jun 20, 2011 at 10:36