0

Sorry I didn't know how to put my question easily, so I detail my problem here.

I use Entity Reference to reference various fields in my contents, and it works good.

Now, I have a "Fruits" content type, with a field named "Picture".

I have another content type, which contains a reference to the fruit "Name", but I want to display the picture and not only the name.

How can I do ?

2 Answers 2

1

With entity reference there are a couple ways to go about this.

  1. You can select the view mode to display (i.e 'teaser') on the display ui of the other content type and then on the 'Fruits' field display ui for the view mode teaser show only the picture. If you use the title module, you'll be able to hide the title on the teaser. If you don't want to use the title module there are other approaches to hide the title.
  2. You can create a view using entity views attach and set up a relationship and then display only those fields. This is more complicated and not as maintainable, I recommend going with #1.

Hope that helps

0

I used your first solution, and it works like a charm ! Didn't know this Entity Reference function, and now I'll add references everywhere in my website !

Thanks a lot :)

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.