GravityView  2.17
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="<?php gv_container_class( 'gv-list-container gv-list-single-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  if ( $this->getFields( 'single_list-image' ) || $this->getFields( 'single_list-description' ) || $this->getFields( 'single_list-content-attributes' ) ) { ?>
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  <?php }
82 
83  if ( $this->getFields( 'single_list-footer-left' ) || $this->getFields( 'single_list-footer-right' ) ) { ?>
84  <div class="gv-grid gv-list-view-footer">
85  <div class="gv-grid-col-1-2 gv-left">
86  <?php $this->renderZone( 'footer-left' ); ?>
87  </div>
88 
89  <div class="gv-grid-col-1-2 gv-right">
90  <?php $this->renderZone( 'footer-right' ); ?>
91  </div>
92  </div>
93  <?php } ?>
94 
95  </div>
96 
97  <?php } } // End foreach $this->getEntries() and $this->getContextFields() ?>
98 
99 </div>
100 
101 <?php gravityview_after(); ?>
gravityview_after()
Definition: class-api.php:1274
gravityview_back_link( $context=null)
Generate HTML for the back link from single entry view.
Definition: class-api.php:953
static get_entry_slug( $id_or_string, $entry=array())
Get the entry slug for the entry.
Definition: class-api.php:550
$entry_slug
Definition: notes.php:30
gravityview_field_output( $passed_args, $context=null)
Output field based on a certain html markup.
Definition: class-api.php:1452
$entry
Definition: notes.php:27
gravityview_before()
Definition: class-api.php:1187