<p>Easy task: you can create your own relations field and use that instead. 
Take a look at the default <a href="https://docs.craftcms.com/api/v3/craft-fields-entries.html" rel="nofollow noreferrer">Entries field</a> here is the php code for it <a href="https://github.com/craftcms/cms/blob/develop/src/fields/Entries.php" rel="nofollow noreferrer">click</a></p>

<p>All you have to do is changing the template that should be rendered so you'll end up with something like </p>

<pre><code>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';
}
</code></pre>

<p>the <code>$inputTemplate</code> is the template that gets rendered in the cp so you'll take the default one <a href="https://github.com/craftcms/cms/blob/develop/src/templates/_includes/forms/elementSelect.html" rel="nofollow noreferrer">here</a> as your base and change the parts you need</p>

<pre><code>&lt;div class="elements"&gt;
    {% for element in elements %}
        {% include "_elements/element" with {
            context: 'field',
            size: (viewMode == 'large' ? 'large' : 'small')
        } %}
    {% endfor %}
&lt;/div&gt;
</code></pre>

<p>to something you like. Because the default content in this include is generated <a href="https://github.com/craftcms/cms/blob/develop/src/web/View.php#L1473" rel="nofollow noreferrer">here</a>. Take that as a reference what you have to change/include in your own template (or hook) together with your icon/thumbnail </p>

CC BY-SA 3.0
2018-01-13T13:45:02.737Z
Thanks so much for such a detailed answer Robin!
The `{% include "_elements/element" %}` lead me to a hook which I wasn't sure whether was overrideable, but I could easily add the necessary tweaks within my main template file, using `element.img...` and a bit of extra CSS
Toby Stokes
CC BY-SA 3.0
2018-01-11T20:23:02.927Z
2018-01-11T20:42:11.403Z
2018-01-11T20:42:11.403Z
Robin Schambach
<p>Is it possible to change the display of the related entries field, to include extra info (hoping to add thumbnail, because otherwise these entries are damn hard to identify!)</p>

<p>I don't <em>think</em> they are quite the same as a standard table view and therefore hookable by <code>defineAdditionalEntryTableAttributes</code>
Or can you override the normal view of the field type?</p>

<p><a href="https://i.sstatic.net/gwgX9.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/gwgX9.png" alt="enter image description here"></a></p>

<control-panel><field>
Possible to change view of related entries field?
# Possible to change view of related entries field?

(Asked by: username_0 on 2018-01-11)

Is it possible to change the display of the related entries field, to include extra info (hoping to add thumbnail, because otherwise these entries are damn hard to identify!)

I don't *think* they are quite the same as a standard table view and therefore hookable by `defineAdditionalEntryTableAttributes`
Or can you override the normal view of the field type?

[![enter image description here](https://i.sstatic.net/gwgX9.png)](https://i.sstatic.net/gwgX9.png)

**Tags:** control-panel, field

---

## 1 answers

### Answer by username_1 on 2018-01-11. Score: 2 | Accepted answer

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

    {% for element in elements %}
        {% include "_elements/element" with {
            context: 'field',
            size: (viewMode == 'large' ? 'large' : 'small')
        } %}
    {% endfor %}


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

> **Comments:**
> **username_0**: Thanks so much for such a detailed answer Robin! The `{% include "_elements/element" %}` lead me to a hook which I wasn't sure whether was overrideable, but I could easily add the necessary tweaks within my main template file, using `element.img...` and a bit of extra CSS  

---

