1

Consider two content types A and B which are in a 1:n relation (say any A entity will be referenced by n entities of type B). Implementing such a relation with entity-reference fields can be done in 2 ways:

  • content type A holds the relations:
    • CT A has its own fields plus one multi-value entity-reference type filed that will store the references to all the B type entities
    • CT B has only its own fields
  • content type B holds the relations:
    • CT A has only its own fields
    • CT B has its own fields plus one single-value entity-reference type field that will store the reference of each B entity to its own parent A type entity.

With the first implementation (A type with a multi-value field) I give the user the possibility to sort the related entities, which is not possible with the second implementation.

Is there anything, on the contrary, that is possible to realize with the second implementation but not possible with the first one?

| improve this question | | | | |
  • 1
    I think it depends what the content types are and who is the end user. You can also use two way entity reference module and have one to many connection from Content A. This will allow the end user to be able to reference without having to edit the original. – chadpeppers Apr 29 '14 at 20:31
  • @chadpeppers: I agree that it could depend on the entity content types! In fact I hope in an answer that could highlight when is better one and when the other direction based on any characteristic of the involved entities. As written I will be implementing several of this relations and I will not be surprised if the correct choice would not be the same for all of them. ..but how to decide this in advance? this is the reason why I created this question. – Diego Mazzaro Apr 29 '14 at 20:58
0

Your claim that "With the first implementation (A type with a multi-value field) I give the user the possibility to sort the related entities, which is not possible with the second implementation." is false.

Some things may be easier one way. Other things may be easier the other way. But ultimately, with Views you should be able to accomplish pretty much anything with both of these approaches. So use the one that's natural for your data.

| improve this answer | | | | |

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.