<p>You're on the right track with both of those. First, <a href="http://buildwithcraft.com/docs/plugins/hooks-reference#modifyEntryTableAttributes" rel="nofollow">modifyEntryTableAttributes</a>.</p>

<blockquote>
  <p>Gives plugins a chance to modify the table columns shown on the entry index page.</p>
</blockquote>

<p>This lets you name the column for your author info. It's a <a href="http://buildwithcraft.com/docs/plugins/hooks-and-events#hooks" rel="nofollow">hook</a>, so you'll need to add a public method with the same name as that that to your main plugin class. You can also limit the column to particular section by checking the <code>$source</code> variable.</p>

<pre><code>public function modifyEntryTableAttributes(&amp;$attributes, $source)
{
    if ($source == 'section:3')
    {
        $attributes['author'] = Craft::t('Author');
    }
}
</code></pre>

<p>Then to actually return the information, you need <a href="http://buildwithcraft.com/docs/plugins/hooks-reference#getEntryTableAttributeHtml" rel="nofollow">getEntryTableAttributeHtml</a>.</p>

<blockquote>
  <p>Gives plugins a chance to customize the HTML of the table cells on the entry index page.</p>
</blockquote>

<p>Here you can just check for the attribute you set above, and return a string.</p>

<pre><code>public function getEntryTableAttributeHtml(EntryModel $entry, $attribute)
{
    if ($attribute == 'author')
    {
        return $entry-&gt;getAuthor()-&gt;getFriendlyName();
    }
}
</code></pre>

CC BY-SA 3.0
2015-08-14T02:46:45.940Z
Yes thats right answer. I had it but it was not working because of a conflict with DashCols plugin indeed. So I disabled the plugin and it works great. Now I just know that its DashCols plugin or all custom made. One way or the other... not both.
migmaker
CC BY-SA 3.0
2015-08-14T01:30:00.257Z
2015-08-14T01:30:00.257Z
Mike Pepper
<p>From what I understand I think the methods you reference are for when you create a plugin with its own custom element type, I don't think you can interact with the entry listing as standard without a plugin. </p>

<p>I do think there is a plugin which might help you achieve this though without having to write your own.</p>

<p><a href="https://github.com/mmikkel/DashCols-Craft/" rel="nofollow">https://github.com/mmikkel/DashCols-Craft/</a></p>

<p>From the looks of things this should let you add custom fields to the entry listing page, I haven't actually used this but it looks solid.</p>

CC BY-SA 3.0
2015-08-13T23:19:16.117Z
I use it all the time but in my case its useless because I want a field from a relationTo entry (the author of the entry)... Not possible with DashCols.
migmaker
CC BY-SA 3.0
2015-08-13T23:07:34.287Z
2015-08-13T23:07:34.287Z
Alec Ritson
<p>In CP Craft Admin in the entries table view I d like to display some authors meta info.<br>
How could I do that in my plugin?<br>
I know <code>public function modifyEntryTableAttributes(&amp;$attributes, $source)</code> and <code>public function getEntryTableAttributeHtml(EntryModel $entry, $attribute)</code>and but I cannot make it work.</p>

<entries-field><author>
Add entry author meta field in entries listing table in CP?
# Add entry author meta field in entries listing table in CP?

(Asked by: username_0 on 2015-08-13)

In CP Craft Admin in the entries table view I d like to display some authors meta info.  
How could I do that in my plugin?  
I know `public function modifyEntryTableAttributes(&$attributes, $source)` and `public function getEntryTableAttributeHtml(EntryModel $entry, $attribute)`and but I cannot make it work.

**Tags:** entries-field, author


---

## 2 answers

### Answer by username_1 on 2015-08-14. Score: 2 | Accepted answer

You're on the right track with both of those. First, modifyEntryTableAttributes.

Gives plugins a chance to modify the table columns shown on the entry index page.

This lets you name the column for your author info. It's a hook, so you'll need to add a public method with the same name as that that to your main plugin class. You can also limit the column to particular section by checking the $source variable.
public function modifyEntryTableAttributes(&$attributes, $source)
{
    if ($source == 'section:3')
    {
        $attributes['author'] = Craft::t('Author');
    }
}

Then to actually return the information, you need getEntryTableAttributeHtml.

Gives plugins a chance to customize the HTML of the table cells on the entry index page.

Here you can just check for the attribute you set above, and return a string.
public function getEntryTableAttributeHtml(EntryModel $entry, $attribute)
{
    if ($attribute == 'author')
    {
        return $entry->getAuthor()->getFriendlyName();
    }
}

> **Comments:**
> **username_0**: Yes thats right answer. I had it but it was not working because of a conflict with DashCols plugin indeed. So I disabled the plugin and it works great. Now I just know that its DashCols plugin or all custom made. One way or the other... not both.  

---

### Answer by username_2 on 2015-08-13. Score: 1

From what I understand I think the methods you reference are for when you create a plugin with its own custom element type, I don't think you can interact with the entry listing as standard without a plugin.

I do think there is a plugin which might help you achieve this though without having to write your own.

<https://github.com/mmikkel/DashCols-Craft/>

From the looks of things this should let you add custom fields to the entry listing page, I haven't actually used this but it looks solid.

> **Comments:**
> **username_0**: I use it all the time but in my case its useless because I want a field from a relationTo entry (the author of the entry)... Not possible with DashCols.  

---

