Hi,
I have 2 content types; "Songs" and "Albums".
Songs content type has a field "Song Title" and "Album" content type has a multi-value field called "Songs".
I have a relation from Album/Songs to Songs/Song Title. Which works pretty well.
Now, I want to add one more field to "Songs" content type called "Appears on Album". The field will have a reference back to the "Albums" content type.
Whenever I create a new album and type in some songs using the already created reference, I also want that "Appears on Album" field on the "Songs" content type to be auto saved with the relevant relationship information.
Is that possible with this module? And if it is, how can I achieve that?
Thanks...
Comments
Comment #1
damien tournoud commentedWhat you want is to build a View and attach it to the Songs content type using EVA.
Also see #1293792: Entity Reference: Two-way referrence (synchronize 2 fields or use one storage for two-way link) for a (somehow related) discussion.
Comment #2
hgurol commentedIm not sure about the View & EVA solution.
I believe #1293792: Entity Reference: Two-way referrence (synchronize 2 fields or use one storage for two-way link) is my medicine.
I will follow-up the other issue, hence closing this one.
Comment #3
damien tournoud commentedThere is nothing to be sure about. In your case, the solution is definitely Views & EVA. The other issue is about something more subtle: non-directed relationships, and I'm not convinced anything is going to happen with this because it feels way out of this module's scope.
Comment #4
greg.1.anderson commentedIf you do not need bidirectional editing, and you only want to place entity back references on your content types, then EVA is definitely the way to go. Worked like a charm for me.
Enable eva, views and views ui. Note that views comes with a "back links" view. Enable it -- or better yet, clone it and work with a copy. This view comes with an enabled menu tab called "What Links here", so once you've done these simple steps, you are already, to a certain extent, "done" if you do not mind that your users need to click on the "What Links here" tab to see the back links.
If you want the back links to appear on the main node page, though, eva can do that. Set up eva as explained here: http://drupal.stackexchange.com/questions/5732/is-there-a-good-tutorial-.... I just set the type to "Node" and the bundle to the content type I wanted to attach it to. Once you do that, the view appears on the "Manage Displays" pane of the selected content type, and you can position them as desired.
I imagine that you could get even more flexibility by using views and panels to place the back links view anywhere on the panel page desired.
Comment #5
greg.1.anderson commentedEVA is actually not the way to go if you are using your entity references to place the entire referenced node on the panel page. In this case, using the views_content module to create a "content pane" of the back links view. Set the "Argument Input" to "From panel argument" (first) and save; then you will be able to add the backlink content pane anywhere in your panel page. The backlinks will show up on the referenced nodes, but they will not show up inside the referenced node content on the page that contains the entity reference fields. Perfect.
If you're not using panels like this, EVA works fine.
Comment #6
lunk rat commentedI decided to go this route:
I followed your instructions. However, the default backlinks view is not working for me. "What links here" is always empty even though there are 100's of entity references. Do you have suggestions? Thanks
Comment #7
Hanscraft commentedI'm having the same issue in that nothing shows as linking here though that is not true!