Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author xnau webdesign

    (@xnau)

    The plugin uses templates to produce all it’s output. You can create a custom template to lay out the data any way you want…you just need a little knowledge of PHP and HTML.

    Check this guide out for details: https://xnau.com/work-2/wordpress-plugins/participants-database/pdb-templates/

    Thread Starter graphics616

    (@graphics616)

    Thanks for the very quick answer.

    I am able to understand by looking at the code in pdb-list-detailed.php that the code continually loops and and creates a new single row of each field of data in each record. I am strong in html and css, but I don’t know php well enough to know how to change it to loop through and create a new row for each field as it comes to it. I really like the positive reviews of this plugin so I really hope I can figure the php part out without taking too much time.

    Thread Starter graphics616

    (@graphics616)

    Thanks for the earlier feedback. For anyone else that might have this problem in the future, my solution was as follows…

    I changed the following code:

    <tbody>
          <?php while ( $this->have_records() ) : $this->the_record(); // each record is one row ?>
            <tr>
              <?php while( $this->have_fields() ) : $this->the_field(); // each field is one cell ?>
    
                <td class="<?php echo $this->field->name ?>-field">
                  <?php $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>No Records Found</td>
            </tr>
          </tbody>

    To this:

    <tbody>
          <?php while ( $this->have_records() ) : $this->the_record(); // each record is one row ?>
            <tr>
    			<td>
    				<table>
    					<?php while( $this->have_fields() ) : $this->the_field(); // each field is one cell ?>
    						<tr>
    							<td class="<?php echo $this->field->name ?>-field">
    								<?php $this->field->print_value() ?>
    							</td>
    						<?php endwhile; // each field ?>
    						</tr>
    				</table>
    			</td>
            </tr>
          <?php endwhile; // each record ?>
          </tbody>
    
        <?php else : // if there are no records ?>
    
          <tbody>
            <tr>
              <td>No Records Found</td>
            </tr>
          </tbody>

    Not sure if that is the most elegant solution, but it worked to turn the horizontal table setup into a vertical table setup.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How do I change pdb_list view from horizontal to vertical for each record.’ is closed to new replies.