0

I want to create some kind of photography website where users will be able to flag some images for later use.

This is the user story:

  1. Photographer upload images of the client event on the website
  2. Page with a gallery is created
  3. A client comes to the gallery page and marks few items using Flag module
  4. A view is created with a list of flagged images so Photographer can get a list of images for further manipulation

The problem is if I use multiple image field there is no way to use Flag module as it works only with nodes, and I have all images in a single node.

There is this issue in Flag module where it says why is not possible.

So I'm wondering if there is a way to convert images to nodes after creating an initial node that contains all of the images?

Or do you have any other suggestion how to handle this?

2
  • Does your question really have anything with ajax?
    – AltaGrade
    Mar 28, 2018 at 19:15
  • Well, i was under impression that some solution would work with Ajax, and now Ajax is also used for flags.
    – Alex
    Mar 29, 2018 at 7:21

2 Answers 2

0

It's easily possible to create a node per uploaded picture using a custom module. Alternatively, you could use https://www.drupal.org/project/node_gallery to let users upload every picture to its node from the very beginning.

0

I kinda went on another way, instead of doing this conversion I actually just used Media module which is now in the Core, and with that, I get every image as a single entity that is then able to be flagged.

So

  • Use Media with Entity Browser instead of regular Image Field
  • Create view block and placed it in the content with contextual filters to take current ID from URL which then lists all images + flags
  • Hide images on manage display in the content type so I don't get duplicates
  • Create another View with flag relationship to list only flagged content

And that did the trick, I now have a gallery on a page where every image has a flag under it, and I'm able to export only flagged ones.

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.