I created a media gallery
I have multiple images and video
I would like to have the owner flag which item she would like to have as her cover for the media gallery.
I created the flag and made it global.
But I'm not quite sure how to enforce that only one gets chosen.

I'd like it to be that I choose any one, it gets flagged. If I choose another one in the same gallery, which is a content type, then the new one would be flagged and the old one unflagged. (even if it is not suddenly refreshed via ajax).

If I had to use rules, I am not sure how to enforce one of these items that are part of a set.

Comments

shabana.navas’s picture

You need to use the 'Trim a flag' feature in Rules, select the flag, type 'flagging_user' for the 'User whose flag to trim' option, and type in '1' for the 'Flag queue size' value.

joachim’s picture

> But I'm not quite sure how to enforce that only one gets chosen.

This is not a terribly good use of Flag -- as you can see, you're having to load it up with extra mechanisms.

> If I choose another one in the same gallery, which is a content type

Are you saying for each new gallery, you create a new content type???

SocialNicheGuru’s picture

Issue summary: View changes

mygallery is a content type which holds references to mymedia, a media content type.
I would like to choose one of the mymedia nodes as the cover image for my gallery

joachim’s picture

Status: Active » Fixed

Flag is not a good choice for your requirements. You either want a reference field on the gallery that points to its cover node, or a boolean field on the media nodes that allows one to be marked as the cover. The first is the one that makes the most sense structurally. In both cases -- and indeed with your build using flag -- you will need custom code for the business logic.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.