PluginProbe
MLSImport: IDX Plugin & MLS Plugin for Real Estate Listings / 7.2.1
MLSImport: IDX Plugin & MLS Plugin for Real Estate Listings v7.2.1
7.2.1 7.2 7.1.2 7.1.1 7.1 7.0.4 7.0.6 7.0.7 6.3.8 6.3.7 6.3.6 6.3.5 6.3.4 6.3.3 6.3.1 trunk 5.7.3 5.7.5 5.8.1 5.8.2 5.8.3 5.8.4 5.8.6 6.0.4 6.0.5 All 36 releases
mlsimport / templates / card-v2.php

card-v2.php in MLSImport: IDX Plugin & MLS Plugin for Real Estate Listings 7.2.1, at templates/card-v2.php

68 lines 2.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Standalone listing card — v2 (horizontal split: photo left, details right).
4 * Theme-overridable: copy to your theme's mlsimport/card-v2.php. Receives:
5 * $post WP_Post The listing post.
6 * $row object|null The mlsimport_listings row (searchable scalars).
7 *
8 * Same data + action slots as v1 (mlsimport_card_view); a different layout.
9 *
10 * @package Mlsimport
11 */
12
13 if ( ! defined( 'ABSPATH' ) ) {
14 exit;
15 }
16
17 // Build the flattened card view model (same shape as v1); only the layout differs here.
18 $mli = mlsimport_card_view( $post, $row );
19 ?>
20 <article class="mlsimport-listing-card mlsimport-listing-card--v2" data-id="<?php echo esc_attr( (string) $mli['id'] ); ?>">
21 <?php
22 // Extension slot: fires before the card link.
23 do_action( 'mlsimport_card_before', $post, $row ); ?>
24 <a class="mlsimport-listing-card__link" href="<?php echo esc_url( $mli['permalink'] ); ?>">
25 <?php
26 // Photo-left half of the split: renders only when a thumbnail is available.
27 if ( $mli['has_thumb'] ) : ?>
28 <div class="mlsimport-listing-card__media" role="img" aria-label="<?php echo esc_attr( $mli['address'] ); ?>" style="background-image:url('<?php echo esc_url( $mli['thumb'] ); ?>')">
29 <?php
30 // Status badge overlaid on the media, only when set.
31 if ( '' !== $mli['status'] ) : ?>
32 <span class="mlsimport-listing-card__badge"><?php echo esc_html( $mli['status'] ); ?></span>
33 <?php endif; ?>
34 </div>
35 <?php endif; ?>
36 <div class="mlsimport-listing-card__body">
37 <?php
38 // Extension slot: top of the card body.
39 do_action( 'mlsimport_card_body_start', $post, $row ); ?>
40 <?php
41 // Price leads the v2 body, only when a formatted price exists.
42 if ( '' !== $mli['price_fmt'] ) : ?>
43 <span class="mlsimport-listing-card__price"><?php echo esc_html( $mli['price_fmt'] ); ?></span>
44 <?php endif; ?>
45 <h3 class="mlsimport-listing-card__title"><?php echo esc_html( $mli['address'] ); ?></h3>
46 <?php
47 // Specs line (beds/baths/area etc.), space-dot joined, only when present.
48 if ( ! empty( $mli['specs'] ) ) : ?>
49 <p class="mlsimport-listing-card__specs"><?php echo esc_html( implode( ' · ', $mli['specs'] ) ); ?></p>
50 <?php endif; ?>
51 <?php
52 // Agency row (office name only in v2), only when the office is set.
53 if ( '' !== $mli['office'] ) : ?>
54 <div class="mlsimport-listing-card__agency"><span class="mlsimport-listing-card__office"><?php echo esc_html( $mli['office'] ); ?></span></div>
55 <?php endif; ?>
56 <?php
57 // Extension slot: bottom of the card body.
58 do_action( 'mlsimport_card_body_end', $post, $row ); ?>
59 </div>
60 </a>
61 <?php
62 // Extension slot: after the media/link (outside the anchor).
63 do_action( 'mlsimport_card_after_media', $post, $row ); ?>
64 <?php
65 // Extension slot: after the whole card.
66 do_action( 'mlsimport_card_after', $post, $row ); ?>
67 </article>
68