1

I have a content type for a collage of six photos. For each photo there is a caption, a link, some link text, and the photo itself. The photos are of different sizes and in different places, and there can be only one photo in each spot per collage.

If I just use Field Groups, I have to create a different CCK field per photo per field, for a total of 24 fields.

If I use a single level of Field Collections I can get that down to six separate Field Collections and four CCK fields, but if I need to make a change that applies to all six photos, I have to make the change six times.

I can use two levels of Field Collections, with a main Collection that contains the four fields, and six other Collections named "Top Left", "Top Right", etc., each of which contains only the main Collection. This is maximally abstracted and would probably do, but it makes the node editing interface look like this:

enter image description here

Those redundant fieldsets are bothersome and are a dead giveaway that the underlying data is architected badly.

Using a single Field Collection that allows multiple values seems the most correct. It gets me down to one Field Collection and four fields. But the repeated groups don't have any identifying information other than their deltas, and if the client ever needs to add one they won't be able to keep track of which line corresponds to which spot in the collage.

Is there a way for me to put identifying information on each of the repeated values of a field or Field collection? Otherwise, is there a better way for me to do this?

2 Answers 2

0

You could simply add an additional field called "Location or Type" to the field collection with the various options. Then you can use that field in a view block to filter by, or even more simply in your node.tpl.php file.

1
  • This wouldn't've worked, because I needed each instance to have one of the six unique identifiers, with all of them used once and no duplicates, and there's no way to enforce that with your solution. Commented Aug 28, 2012 at 20:58
0

Finding no acceptable answer, I ended up just creating 24 separate fields and six field groups to contain them. Horrible in many ways, but with the benefit of actually working.

Your Answer

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

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