My question: Is it possible to reference a field to a node, and also to a user?

I want to keep track of scores scored by users while playing a boardgame. So, I'll need a reference between nodes (boardgame) and users. I'm using the "entity reference" for this.

With the module field_group and field_group_multiple, I can make rows with user field, score field, etc... But the problem here is: the score field is linked to the node, not to the user. (So if I want to make a view and get all scores scored by a player, this will be not possible.)

  • Have you tried the [references] module? (drupal.org/project/references) – saadlulu Jan 23 '13 at 20:50
  • who is the author of the boardgame node is it the player or the admin? – Mohammed Shameem Jan 23 '13 at 21:02
  • I'm using the entity_reference module to make a reference to all players, so they are not admin's, but that doesn't matter. A boardgame is played with more then one player :) – screaming SiLENCE Jan 24 '13 at 8:31

I found an answer. The modules entity_reference and field_collection are what I needed. field_collection makes a collection that has a reference to the node, and also to the user_reference. An awesome module!

| improve this answer | |

**EDIT This would probably be best as a module then. You could either create separate views of each player or game instance and use view_embed_view() function or You could use a noad_load() to grab the information as well.



| improve this answer | |
  • That's ok for one game and one player, but each boardgame is played with x players. So there has to be a connection between the score, the boardgame AND the player. – screaming SiLENCE Jan 24 '13 at 8:32
  • Check out my edit – chadpeppers Jan 24 '13 at 15:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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