Hello,
I'm trying to find a way to display a image instead of a label on a entity reference. This image should also contain the link towards the referenced content.
Is that possible with entity reference? It seems to be a common feature but I can't find how to make it.

Beside I tried to do the same by using a view, but as I need to use a block display I cannot use the contextual filter, so no way to select only the entities pointing to my current node.

Note: so more functionnaly, i have 2 types of nodes: businesses and reviews. A review is talking about 1 business, and 1 business can have only 1 review. On pages business I want to display a link to the related reviewed, using a image. I saw thousand of screencasts but couldn't find a way yet :s

Comments

amitaibu’s picture

> I'm trying to find a way to display a image instead of a label on a entity reference

You can already have the formatter show the "Rendered entity" in the "Manage display" -- so you can show the image (and other stuff).

trictis’s picture

Thank you for your message Amitaibu.
Sorry but in "Manage Display", when i select "rendered entity", I see "full content", "teaser", RSS, "Search index" and "search result".. and I need to display only one image with a link on it. I could use teaser and set the image only, but it wouldn't be a link..

alexmc’s picture

Hmmm, this is a very similar question to the one I just asked... feel free to delete my question.

I don't see any way of controlling the "rendered entity" so I can decide what parts of it to display, or how...

alexmc’s picture

trictis, I think I have done what you asked for using the module http://drupal.org/project/entityreference_view_widget

Well, I am not sure about the block handling, but I think I have gotten this working for views.... Give me a shout if you want to discuss it further. I am trying to solve similar problems.

Chaulky’s picture

You can pretty easily create new view modes for better control over the display of the "rendered entity". It does require some coding (or use of modules like Display Suite), but isn't difficult. Checkout of the DrupalCon Denver 2012 video about view modes at http://denver2012.drupal.org/program/sessions/view-modes-many-faces-your.... That might help you solve your particular needs.

yannou’s picture

When

  • you create a view mode for a vocabulary (with display suite for instance, or using the entityreference_view_widget);
  • configure this new view to display only the logo of a term for instance;
  • refers to this term by entity reference in a node and display this field as a rendered entity using the previous created view;

the result is : the title of the term is displayed with the created view, despite the title is not in the view. Is it possible to remove it ?

Usage : using the logo of term instead the term.

yannou’s picture

Issue summary: View changes

tried new tricks that didn't work neither

MustangGB’s picture

Issue summary: View changes
Status: Active » Closed (outdated)