GravityView  1.19.4
The best, easiest way to display Gravity Forms entries on your website.
list-single.php
Go to the documentation of this file.
1 <?php
2 /**
3  * Display a single entry when using a list template
4  *
5  * @package GravityView
6  * @subpackage GravityView/templates
7  *
8  * @global GravityView_View $this
9  */
10 ?>
11 <?php gravityview_before(); ?>
12 
13 <div class="gv-container gv-list-single-container gv-list-container">
14  <p class="gv-back-link"><?php echo gravityview_back_link(); ?></p>
15  <?php
16  if( $this->getContextFields() ) {
17  foreach ( $this->getEntries() as $entry ) {
18  $this->setCurrentEntry( $entry );
19 
20  $entry_slug = GravityView_API::get_entry_slug( $entry['id'], $entry );
21  ?>
22 
23  <div id="gv_list_<?php echo esc_attr( $entry_slug ); ?>" class="gv-list-view">
24  <?php
25 
26  if ( $this->getFields( 'single_list-title' ) || $this->getFields( 'single_list-subtitle' ) ) { ?>
27  <div class="gv-list-view-title">
28  <?php
29  if ( $fields = $this->getFields( 'single_list-title' ) ) {
30  $i = 0;
31  $title_args = array(
32  'entry' => $entry,
33  'form' => $this->form,
34  'hide_empty' => $this->atts['hide_empty'],
35  );
36  foreach ( $fields as $field ) {
37  $title_args['field'] = $field;
38  if ( 0 === $i ) {
39  $title_args['markup'] = '<h3 id="{{ field_id }}" class="{{class}}">{{label}}{{value}}</h3>';
40  echo gravityview_field_output( $title_args );
41  } else {
42  $title_args['wpautop'] = true;
43  echo gravityview_field_output( $title_args );
44  }
45  $i++;
46  }
47  }
48 
49  $this->renderZone('subtitle', array(
50  'wrapper_class' => 'gv-list-view-subtitle',
51  'markup' => '<h4 id="{{ field_id }}" class="{{class}}">{{label}}{{value}}</h4>',
52  ));
53 
54  ?>
55  </div>
56  <?php
57  }
58  ?>
59 
60  <div class="gv-list-view-content">
61  <?php
62 
63  $this->renderZone('image', array(
64  'wrapper_class' => 'gv-list-view-content-image gv-grid-col-1-3',
65  'markup' => '<h4 id="{{ field_id }}" class="{{class}}">{{label}}{{value}}</h4>',
66  ));
67 
68  $this->renderZone('description', array(
69  'wrapper_class' => 'gv-list-view-content-description',
70  'label_markup' => '<h4>{{label}}</h4>',
71  'wpautop' => true,
72  ));
73 
74  $this->renderZone('content-attributes', array(
75  'wrapper_class' => 'gv-list-view-content-attributes',
76  'markup' => '<p id="{{ field_id }}" class="{{class}}">{{label}}{{value}}</p>',
77  ));
78 
79  ?>
80  </div>
81 
82  <?php if ( $this->getFields( 'single_list-footer-left' ) || $this->getFields( 'single_list-footer-right' ) ) { ?>
83  <div class="gv-grid gv-list-view-footer">
84  <div class="gv-grid-col-1-2 gv-left">
85  <?php $this->renderZone( 'footer-left' ); ?>
86  </div>
87 
88  <div class="gv-grid-col-1-2 gv-right">
89  <?php $this->renderZone( 'footer-right' ); ?>
90  </div>
91  </div>
92  <?php } ?>
93 
94  </div>
95 
96  <?php } } // End foreach $this->getEntries() and $this->getContextFields() ?>
97 
98 </div>
99 
100 <?php gravityview_after(); ?>
gravityview_field_output($passed_args)
Output field based on a certain html markup.
Definition: class-api.php:1148
gravityview_after()
Definition: class-api.php:1023
gravityview_back_link()
Generate HTML for the back link from single entry view.
Definition: class-api.php:814
$entry_slug
Definition: notes.php:30
$entry
Definition: notes.php:27
gravityview_before()
Definition: class-api.php:999
static get_entry_slug($id_or_string, $entry=array())
Get the entry slug for the entry.
Definition: class-api.php:567
$field
Definition: gquiz_grade.php:11