8 if ( ! isset( $gravityview ) || empty( $gravityview->template ) ) {
9 gravityview()->log->error(
'{file} template loaded without context', array(
'file' => __FILE__ ) );
16 $template::body_before( $gravityview );
19 if ( ! $gravityview->entries->count() ) {
21 $no_results_css_class =
'gv-no-results gv-no-results-text';
23 if ( 1 === (
int) $gravityview->view->settings->get(
'no_entries_options',
'0' ) ) {
24 $no_results_css_class =
'gv-no-results gv-no-results-form';
28 <div
class=
"gv-list-view <?php echo esc_attr( $no_results_css_class ); ?>">
29 <div
class=
"gv-list-view-title">
36 foreach ( $gravityview->entries->all() as
$entry ) {
41 $entry_class = $template::entry_class(
'gv-list-view',
$entry, $gravityview );
44 <div
id=
"gv_list_<?php echo esc_attr( $entry_slug ); ?>" class=
"<?php echo gravityview_sanitize_html_class( $entry_class ); ?>">
49 $template::entry_before(
$entry, $gravityview );
57 extract(
$template->extract_zone_vars( array(
'title',
'subtitle' ) ) );
59 if ( $has_title || $has_subtitle ) {
62 $template::entry_before(
$entry, $gravityview,
'title' );
66 <div
class=
"gv-list-view-title">
71 if ( $did_main == 0 ) {
73 $extras = array(
'wpautop' =>
false,
'markup' =>
'<h3 class="{{ class }}">{{ label }}{{ value }}</h3>' );
75 $extras = array(
'wpautop' =>
true );
78 $extras[
'zone_id'] =
'directory_list-title';
79 echo $gravityview->template->the_field(
$field,
$entry, $extras );
82 if ( $has_subtitle ) {
83 ?><div
class=
"gv-list-view-subtitle"><?php
85 foreach ( $subtitle->all() as $i =>
$field ) {
87 if ( $did_main == 0 ) {
89 $extras = array(
'markup' =>
'<h4 id="{{ field_id }}" class="{{ class }}">{{ label }}{{ value }}</h4>' );
92 $extras[
'zone_id'] =
'directory_list-subtitle';
93 echo $gravityview->template->the_field(
$field,
$entry, $extras );
102 $template::entry_after(
$entry, $gravityview,
'title' );
114 extract(
$template->extract_zone_vars( array(
'image',
'description',
'content-attributes' ) ) );
116 $has_content_before_action = has_action(
'gravityview/template/list/entry/content/before' );
117 $has_content_after_action = has_action(
'gravityview/template/list/entry/content/after' );
119 if ( $has_image || $has_description || $has_content_attributes || $has_content_before_action || $has_content_after_action ) {
121 <div
class=
"gv-grid gv-list-view-content">
126 $template::entry_before(
$entry, $gravityview,
'content' );
129 ?><div
class=
"gv-grid-col-1-3 gv-list-view-content-image"><?php
131 echo $gravityview->template->the_field(
$field,
$entry, array(
'zone_id' =>
'directory_list-image' ) );
136 if ( $has_description ) {
137 ?><div
class=
"gv-grid-col-2-3 gv-list-view-content-description"><?php
139 $extras = array(
'wpautop' =>
true,
'zone_id' =>
'directory_list-description',
'label_markup' =>
'<h4>{{ label }}</h4>' );
140 echo $gravityview->template->the_field(
$field,
$entry, $extras );
145 if ( $has_content_attributes ) {
146 ?><div
class=
"gv-grid-col-3-3 gv-list-view-content-attributes"><?php
148 $extras = array(
'zone_id' =>
'directory_list-content-attributes',
'markup' =>
'<p id="{{ field_id }}" class="{{ class }}">{{ label }}{{ value }}</p>' );
149 echo $gravityview->template->the_field(
$field,
$entry, $extras );
155 $template::entry_after(
$entry, $gravityview,
'content' );
169 extract(
$template->extract_zone_vars( array(
'footer-left',
'footer-right' ) ) );
172 if ( $has_footer_left || $has_footer_right ) {
174 $template::entry_before(
$entry, $gravityview,
'footer' );
177 <div
class=
"gv-grid gv-list-view-footer">
178 <div
class=
"gv-grid-col-1-2 gv-left">
180 foreach ( $footer_left->all() as
$i =>
$field ) {
181 echo $gravityview->template->the_field(
$field,
$entry, array(
'zone_id' =>
'directory_list-footer-left' ) );
186 <div
class=
"gv-grid-col-1-2 gv-right">
188 foreach ( $footer_right->all() as $i =>
$field ) {
189 echo $gravityview->template->the_field(
$field,
$entry, array(
'zone_id' =>
'directory_list-footer-right' ) );
198 $template::entry_after(
$entry, $gravityview,
'footer' );
203 $template::entry_after(
$entry, $gravityview );
213 $template::body_after( $gravityview );
gv_no_results( $wpautop=true, $context=null)
if(! isset( $gravityview)||empty( $gravityview->template)) $template
The entry loop for the list output.
static get_entry_slug( $id_or_string, $entry=array())
Get the entry slug for the entry.
gravityview()
The main GravityView wrapper function.