Maybe a feature request.

Styling of selected items would be nice.
Example:
If I have selected a user, then selected item shows the username, but it would be cool to show the userpicture and the username.

Is there a solution to style seleceted items and show additional data?

(edited it, typing mistakes)

Comments

bennos’s picture

Issue summary: View changes
malovanets’s picture

You can already customise the view from which you pick your entities (display avatars as fields for example), but the current version of the module does not provide the feature you are looking for just "from the box". The best you can do at the moment, is to alter the 2 themes defined by the module. Their names are: entityreference_view_widget_widget and entityreference_view_widget_rows.

The second one is responsible for a single row (field value), the first is a wrapper around the values (including field title, "add" button etc).

jsacksick’s picture

Status: Active » Closed (fixed)
titouille’s picture

Hi,

Can anyone confirm that he success to override entityreference_view_widget_rows ??

I added a "bartik_entityreference_view_widget_rows" function in the bartik theme but nothing appends, even with multiple time cache clear. I tried to use hook_theme_registry_alter to change the called function, ie :

function foutoir_theme_registry_alter(&$theme_registry) {
  
  if (!empty($theme_registry['entityreference_view_widget_rows']['function'])) {
    $theme_registry['entityreference_view_widget_rows']['function'] = 'foutoir_entityreference_view_widget_rows';
  }
}

But no way, I'm unable to override the standard function. If anyone can point me a solution it would be nice. Thanks in advance for any suggestion.