<p>A simple-ish way you could do this is by using the <a href="https://plugins.craftcms.com/preparse-field" rel="nofollow noreferrer">pre-parse field</a> to parse <code>{{ entry.uid }}</code>.</p>
<p>This will then give you an extra column with the unique ID. You can then use <a href="https://plugins.craftcms.com/cp-js" rel="nofollow noreferrer">Control panel JS</a> to change that into a link/create a button. Something like:</p>
<pre><code>$(document).ready(function() {
    Craft.elementIndex.on('updateElements ', function(data){
        if (data.target.$source.data('handle') == 'your-section-handle') {
            $('td[data-attr=field:your-field-id]').each(function(){
                &lt;!-- JS code to change uid into link --&gt;
            });
        }
    });
});
</code></pre>
<p>Replacing <code>your-section-handle</code> and <code>your-field-id</code>.</p>

CC BY-SA 4.0
2021-07-23T09:40:13.453Z
Of course, there already is a UID column – so you could just use that instead of Pre-parse.
dmatthams
CC BY-SA 4.0
2021-07-23T17:50:00.757Z
Thanks, dmatthams. If I put the correct section handle and field ID in place, with no extra code, should this run without issue? I decided to just target the entry ID field (id), because I can build my button from that.

`$(document).ready(function() {
  Craft.elementIndex.on('updateElements ', function(data){
      if (data.target.$source.data('handle') == 'test') {
          $('td[data-attr=field:id]').each(function(){
              //
          });
      }
  });
});`
4midori
CC BY-SA 4.0
2021-07-23T09:29:57.533Z
2021-07-23T09:41:37.097Z
2021-07-23T09:41:37.097Z
dmatthams
<p>Is there a way to add a column to the control panel display of entries? I would strongly prefer to not write a plug-in for this. The contents in the column would be nothing more than a button that links to a URL containing the UID of the entry. Note, I am not using the Commerce plug-in here.</p>
<p>If I have to write a plug-in, what would be the simplest scaffold to use?</p>
<p><a href="https://i.sstatic.net/7onxx.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/7onxx.png" alt="enter image description here" /></a></p>

<plugin-development><control-panel>
Adding column to CP entries without writing plugin?
# Adding column to CP entries without writing plugin?

(Asked by: username_0 on 2021-07-22)

Is there a way to add a column to the control panel display of entries? I would strongly prefer to not write a plug-in for this. The contents in the column would be nothing more than a button that links to a URL containing the UID of the entry. Note, I am not using the Commerce plug-in here.

If I have to write a plug-in, what would be the simplest scaffold to use?

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

**Tags:** plugin-development, control-panel

---

## 1 answers

### Answer by username_1 on 2021-07-23. Score: 3

A simple-ish way you could do this is by using the pre-parse field to parse {{ entry.uid }}.
This will then give you an extra column with the unique ID. You can then use Control panel JS to change that into a link/create a button. Something like:
$(document).ready(function() {
    Craft.elementIndex.on('updateElements ', function(data){
        if (data.target.$source.data('handle') == 'your-section-handle') {
            $('td[data-attr=field:your-field-id]').each(function(){
                
            });
        }
    });
});

Replacing your-section-handle and your-field-id.

> **Comments:**
> **username_1**: Of course, there already is a UID column – so you could just use that instead of Pre-parse.  
> **username_0**: Thanks, dmatthams. If I put the correct section handle and field ID in place, with no extra code, should this run without issue? I decided to just target the entry ID field (id), because I can build my button from that.  `$(document).ready(function() {   Craft.elementIndex.on('updateElements ', function(data){       if (data.target.$source.data('handle') == 'test') {           $('td[data-attr=field:id]').each(function(){               //           });       }   }); });`  

---

