Skip to content

Instantly share code, notes, and snippets.

@xnau
Created October 2, 2025 17:22
Show Gist options
  • Select an option

  • Save xnau/b123857324ce37df9b0028bb1db19693 to your computer and use it in GitHub Desktop.

Select an option

Save xnau/b123857324ce37df9b0028bb1db19693 to your computer and use it in GitHub Desktop.
Utility template for displaying only the fields in a Participants Database record edit display
<?php
/**
* special purpose template that only shows the named fields as bare elements
*
*/
if ( $this->record_found() ) :
while ( $this->have_groups() ) : $this->the_group();
while ( $this->have_fields() ) : $this->the_field();
?>
<div class="form-group <?php $this->field->print_element_class() ?>">
<?php if ( $this->field->has_title() ) : ?>
<label>
<?php $this->field->print_label() ?>
</label>
<?php endif ?>
<div class="input-group" >
<?php $this->field->print_element_with_id(); ?>
</div><!-- .input-group -->
<?php if ( $this->field->has_help_text() ) : ?>
<p class="help-block helptext"><?php $this->field->print_help_text() ?></p>
<?php endif ?>
</div><!-- .form-group -->
<?php endwhile; // field loop ?>
<?php endwhile; // group loop ?>
<?php endif ?>
@xnau
Copy link
Author

xnau commented Oct 2, 2025

This template won't result in a working record edit display, it is a special-use template for displaying only the HTML for specific fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment