It would be nice to be able to theme the label.

IE: To create an autocomplete like:

prefix . label . (eid) => <strong>Entity Label</strong>, Some other property (eid)

Maybe replace

$matches[$prefix . $key] = '<div class="reference-autocomplete">' . $label . '</div>';

with

$matches[$prefix . $key] = $handler->prepareAutocompleteLabel($entity_id, $label);

class EntityReferenceHandler_base implements EntityReferenceHandler {
  .....
  public function prepareAutocompleteLabel($entity_id, $label) {
    return '<div class="reference-autocomplete">' . $label . '</div>';
  }
}

Of choose having the actual entity here would be even better, but reloading this should have minimal overhead with minimal coding changes required.

BTW, this is a very nice replacement for the old References module!

Comments

lsolesen’s picture

Status: Active » Postponed (maintainer needs more info)

Did you solve your issue?