Title: Edit Record from List view
Last modified: August 31, 2016

---

# Edit Record from List view

 *  Resolved [musicmschell](https://wordpress.org/support/users/musicmschell/)
 * (@musicmschell)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/edit-record-from-list-view/)
 * First of all thank you for a wonderful plugin. I must apologize for reaching 
   out to you but I have gone through all the documentation and support forums trying
   to allow someone to edit a record from the [pdb-list] page. Right now I have 
   a link showing up that is clickable but it takes you to the [pdb_single] page
   which is not editable. So far I have done the following:
 * 1) Copied “pdb-list-default.php” into “wp-content/themes/lifestyle/templates”
   and added the following:
 *     ```
       <tbody>
       <?php while ( $this->have_records() ) : $this->the_record(); // each record is one row ?>
           <?php $field = new PDb_Template($this); ?>
         <tr>
           <?php while( $this->have_fields() ) : $this->the_field(); // each field is one cell ?>
             <td class="<?php echo $this->field->name ?>-field">
               <?php
               /*
                * put the edit link URL into the link property of the field
                */
               if ($this->field->name == 'edit_link') {
                 $this->field->link = $record->get_edit_link();
               }
               $this->field->print_value();
               ?>
             </td>
         <?php endwhile; // each field ?>
         </tr>
       <?php endwhile; // each record ?>
       </tbody>
       ```
   
 * 2) I’ve added “edit_link” in the Manage Database Fields with the following properties:
   –
   Name: edit_link – Title: Edit User – Default: EDIT – Form Element: Text-line –
   Read-only
 * 3) Made sure Single Record Page points to the page with [pdb_single].
 * I’m at a loss. I’ve tried this [site ](https://xnau.com/adding-an-edit-record-link-to-the-frontend-list/)
   but it appears to be down. Any help would be greatly appreciated! Thank you!
 * [http://www.sweetcheeksdiaperbanks.org/agency-list/](http://www.sweetcheeksdiaperbanks.org/agency-list/)
 * [https://wordpress.org/plugins/participants-database/](https://wordpress.org/plugins/participants-database/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [musicmschell](https://wordpress.org/support/users/musicmschell/)
 * (@musicmschell)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/edit-record-from-list-view/#post-6944188)
 * I stumbled upon another user that posted the php from their custom template. 
   The code is as follows:
 *     ```
       <?php
       /*
        *
        * template for participants list shortcode output
        *
        * this is the default template which formats the list of records as a table
        * using shortcut functions to display the componenets
        *
        * If you need more control over the display, look at the detailed template
        * (pdb-list-detailed.php) for an example of how this can be done
        *
        * Please note that if you have more than one list on a page, searching, sorting
        * and pagination will not work correctly.
        *
       */
       ?>
       <div class="wrap <?php echo $this->wrap_class ?>">
       <a name="<?php echo $this->list_anchor ?>" id="<?php echo $this->list_anchor ?>"></a>
       <?php
         /*
          * SEARCH/SORT FORM
          *
          * the search/sort form is only presented when enabled in the shortcode.
          *
          */
         $this->show_search_sort_form();
   
         /* LIST DISPLAY */
         /*
          * NOTE: the container for the list itself (excluding search and pagination
          * controls) must have a class of "list-container" for AJAX search/sort to
          * function
          */
       ?>
         <table class="wp-list-table widefat fixed pages list-container" cellspacing="0" >
   
           <?php
           // print the count if enabled in the shortcode
       		$this->print_list_count($wrap_tag = false);
           ?>
           <?php if ( $record_count > 0 ) : // print only if there are records to show ?>
   
             <thead>
               <tr>
                 <?php /*
                  * this function prints headers for all the fields
                  * replacement codes:
                  * %2$s is the form element type identifier
                  * %1$s is the title of the field
                  */
                 $this->print_header_row( '<th class="%2$s" scope="col">%1$s</th>' );
                 ?>
               </tr>
             </thead>
   
             <tbody>
   
       <?php while ( $this->have_records() ) : $this->the_record(); // each record is one row ?>
           <?php $record = new PDb_Template($this); ?>
         <tr>
           <?php while( $this->have_fields() ) : $this->the_field(); // each field is one cell ?>
             <td class="<?php echo $this->field->name ?>-field">
               <?php
               /*
                * put the edit link URL into the link property of the field
                */
               if ($this->field->name == 'edit_link') {
                 $this->field->link = $record->get_edit_link();
               }
               $this->field->print_value();
               ?>
             </td>
         <?php endwhile; // each field ?>
         </tr>
       <?php endwhile; // each record ?>
       </tbody>
   
           <?php else : // if there are no records ?>
   
             <tbody>
               <tr>
                 <td><?php if ($this->is_search_result === true)  echo Participants_Db::$plugin_options['no_records_message'] ?></td>
               </tr>
             </tbody>
   
           <?php endif; // $record_count > 0 ?>
   
       	</table>
         <?php
         /*
          * this shortcut function presents a pagination control with default layout
          */
         $this->show_pagination_control();
         ?>
       </div>
       ```
   
 * Thank you again for a awesome plugin!!! Aloha my friend.

Viewing 1 replies (of 1 total)

The topic ‘Edit Record from List view’ is closed to new replies.

 * ![](https://ps.w.org/participants-database/assets/icon-256x256.jpg?rev=1389807)
 * [Participants Database](https://wordpress.org/plugins/participants-database/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/participants-database/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/participants-database/)
 * [Active Topics](https://wordpress.org/support/plugin/participants-database/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/participants-database/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/participants-database/reviews/)

## Tags

 * [front-end](https://wordpress.org/support/topic-tag/front-end/)
 * [pdb-list](https://wordpress.org/support/topic-tag/pdb-list/)

 * 1 reply
 * 1 participant
 * Last reply from: [musicmschell](https://wordpress.org/support/users/musicmschell/)
 * Last activity: [10 years, 5 months ago](https://wordpress.org/support/topic/edit-record-from-list-view/#post-6944188)
 * Status: resolved