]> _ Git - swedish-care.git/commitdiff
Update contact block layout to use static image instead of Google Map
authorStephen Cameron <stephen@cubedesigners.com>
Mon, 3 Jun 2019 10:19:23 +0000 (12:19 +0200)
committerStephen Cameron <stephen@cubedesigners.com>
Mon, 3 Jun 2019 10:19:23 +0000 (12:19 +0200)
wp-content/themes/swedishcare/blocks/layouts/layout-contact_blocks.php

index bd365805aa17faf1e0b77bd0c7afeda6ea277305..fd8f1796674c4356e2263ddabf06c7cb59436eb9 100644 (file)
@@ -1,11 +1,14 @@
 <?php
        $header = get_sub_field( 'header' );
-       $map = get_sub_field( 'map' );
+       //$map = get_sub_field( 'map' );
        $map_top = get_sub_field( 'map_top' );
+       $map_image = get_sub_field( 'map_image' );
+       $map_link = get_sub_field( 'map_link' );
 ?>
 <?php if ( have_rows( 'blocks' ) || $map ) : ?>
        <section class="contact-block">
                <div class="container">
+                       <!--
                        <?php if ( $map && $map_top ) : ?>
                                <div class="map-block">
                                        <div class="map-holder" data-marker="<?php echo $map['lat']; ?>, <?php echo $map['lng']; ?>" data-pin="<?php echo get_template_directory_uri(); ?>/images/pin.png">
                                        </div>
                                </div>
                        <?php endif; ?>
+                       -->
+                       <?php if ($map_image && $map_top): ?>
+                               <a href="<?php echo $map_link ?>" target="_blank" rel="noopener">
+                                       <div class="map-block-image" style="background: url(<?php echo $map_image ?>) center no-repeat; background-size: cover; height: 440px"></div>
+                               </a>
+                       <?php endif; ?>
+
                        <div class="frame">
                                <?php if ( $header ) : ?>
                                        <h1><?php echo $header; ?></h1>
@@ -38,6 +48,7 @@
                                        <?php endwhile; ?>
                                </ul>
                        </div>
+                       <!--
                        <?php if ( $map && ! $map_top ) : ?>
                                <div class="map-block">
                                        <div class="map-holder" data-marker="<?php echo $map['lat']; ?>, <?php echo $map['lng']; ?>" data-pin="<?php echo get_template_directory_uri(); ?>/images/pin.png">
                                        </div>
                                </div>
                        <?php endif; ?>
+                       -->
+                       <?php if ($map_image && ! $map_top): ?>
+                               <a href="<?php echo $map_link ?>" target="_blank" rel="noopener">
+                                       <div class="map-block-image" style="background: url(<?php echo $map_image ?>) center no-repeat; background-size: cover; height: 440px"></div>
+                               </a>
+                       <?php endif; ?>
                </div>
        </section>
 <?php endif; ?>
\ No newline at end of file