We have a content type that includes a field that allows users to upload multiple photos. We also have a view that displays the resulting nodes.

We want to attach flags to the individual photos within the nodes (not to the entire node). Is there a way to do this?

Comments

joachim’s picture

Version: 7.x-3.5 » 7.x-3.x-dev
Category: Support request » Feature request
Status: Active » Closed (won't fix)

What you're talking about is flagging individual field values. There's no way of doing that currently.

You could in theory write a new Flag handler to do this, but you'd run into a lot of problems.

The main one is that flaggable objects need a numeric ID that's unique. However, field items don't have this. The field delta is only unique within the single entity. You could somehow combine the delta and the entity ID (but you'd need some way to be able to reliably uncombine them). But even that won't cut it in the case that your field is also applied to other entity types -- in which case the entity IDs are not necessarily unique.

You'd have a lot of work to do to get a UI for them too.

A simpler solution would be to change your site's structure to have images as nodes, though that would require a lot of restructuring initially.