Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
lsolesen CreditAttribution: lsolesen commentedDid you solve your issue?