Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-07-23T09:40:13.453Z
Answers.Text: Of course, there already is a UID column – so you could just use that instead of Pre-parse.
Answers.UserDisplayName: dmatthams
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-07-23T17:50:00.757Z
Answers.Text: 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(){
                //
            });
        }
    });
  });`
Answers.UserDisplayName: 4midori
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-07-23T09:29:57.533Z
Answers.LastActivityDate: 2021-07-23T09:41:37.097Z
Answers.LastEditDate: 2021-07-23T09:41:37.097Z
Answers.UserDisplayName: dmatthams
Body: <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>
  
Tags: <plugin-development><control-panel>
Title: Adding column to CP entries without writing plugin?
ThreadText: # 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](https://plugins.craftcms.com/preparse-field) to parse `{{ entry.uid }}`.
  
  This will then give you an extra column with the unique ID. You can then use [Control panel JS](https://plugins.craftcms.com/cp-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(){
                  <!-- JS code to change uid into link -->
              });
          }
      });
  });
  
  ```
  
  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, username_1. 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(){               //           });       }   }); });`  
  
  ---
  
  