I have a photo contest website where every participant can upload up to 3 photos. I created a participant node type with a multiple file upload with max 3 entries.

How can I tag/edit/flag individual photos to filter/choose the best ones while they belong to a single node? How can I accomplish this? Is there any contributed module to help me, or do I need to change the logic?
I thought that a solution could be that every photo needs to be a separate node linked to participant's node through entity reference, but how do I create 3 separate photo nodes on a single form submit?


2 Answers 2

  • you could create a form with multiple file upload fields, and on submit have it create three nodes, adding the file information to a file field in the new node

Form API

This module provides a new interface for creating nodes where the users are able to select the fields what they want to use for creating the nodes. It is designed to create multiple nodes in one round, it's possible to add more node input rows on-the-fly.

I have never used it, but it appears to do the first suggestion automatically for you. Even if it wasn't perfect, you could modify it into a custom module using it as a framework to build upon

  • using a temp content type that is only used as a form (for simplicity), or creating a custom form via code or module, you could create a Rule acting upon submit to create three of the actual image nodes, using the field values from the temp content type. If Multi Node Add doesn't work, this has an advantage of the easiest (though probably least performance) way of accomplishing it of these options

The Rules module allows site administrators to define conditionally executed actions based on occurring events (known as reactive or ECA rules). It's a replacement with more features for the trigger module in core and the successor of the Drupal 5 workflow-ng module.


At first I thought to create a rule action too, but after some research I found the File entity module, that allows me to treat single uploaded photos like entities, where I added a Flag field, that integrates perfectly with the Views module. In this way, I solved my problem very quickly without changing the logic of my application.

Your Answer

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

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