Easy task: you can create your own relations field and use that instead.
Take a look at the default Entries field here is the php code for it click
All you have to do is changing the template that should be rendered so you'll end up with something like
class MyCustomRelationField extends BaseRelationField
{
// Static
// =========================================================================
/**
* @inheritdoc
*/
public static function displayName(): string
{
return Craft::t('app', 'My awesome field');
}
/**
* @inheritdoc
*/
protected static function elementType(): string
{
return Entry::class;
}
/**
* @inheritdoc
*/
public static function defaultSelectionLabel(): string
{
return Craft::t('app', 'Add an entry');
}
/**
* @var string Template to use for field rendering
*/
protected $inputTemplate = 'path/to/your/custom/template';
}
the $inputTemplate
is the template that gets rendered in the cp so you'll take the default one here as your base and change the parts you need
<div class="elements">
{% for element in elements %}
{% include "_elements/element" with {
context: 'field',
size: (viewMode == 'large' ? 'large' : 'small')
} %}
{% endfor %}
</div>
to something you like. Because the default content in this include is generated here. Take that as a reference what you have to change/include in your own template (or hook) together with your icon/thumbnail