changing ids for the dropdown community map
authorAnthony Talarico <talarico@gaslightmedia.com>
Tue, 23 Aug 2016 18:33:21 +0000 (14:33 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Tue, 23 Aug 2016 18:33:21 +0000 (14:33 -0400)
parts/community-map-svg.php
parts/community-map.php

index 7da2e21..08af49d 100644 (file)
@@ -1,7 +1,5 @@
 <?php
-
     $suffix = $template_args['community_map_caller'];
-
 ?>
   <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
         viewBox="0 0 376.64 376.64" enable-background="new 0 0 376.64 376.64" xml:space="preserve" width="376.64" height="376.64">
index d0e7379..5b229f0 100644 (file)
@@ -1,21 +1,23 @@
+
 <ul id="interactive-map">
     <li class="drop-centered menu-item menu-item-object-page menu-item-has-children has-dropdown not-click">
         <a href="<?php echo get_permalink(155); ?>">COMMUNITIES</a>
         <ul class="dropdown">
             <div id="map">
-                 <?php get_template_part('parts/community-map-svg'); ?>
+                 <!-- <?php //get_template_part('parts/community-map-svg'); ?> -->
+                 <?php hm_get_template_part( 'parts/community-map-svg', [ 'community_map_caller' => 'dropdown' ] ); ?>
             </div>
             <div id="mapRegionData">
             <?php $community_page_object = get_page( 155 ); ?>
             <?php  $community_page_image = wp_get_attachment_url( get_post_thumbnail_id( 155 )); ?>
-           
+
             <?php $community_page_content = substr(strip_tags($community_page_object->post_content),0, 300) . "..."; ?>
             <?php $community_page_content = json_encode(strip_shortcodes($community_page_content)); ?>
-               
+
                 <a class="map-page-link" href="#"><div class="map-image-container"></div></a>
                 <div class="map-page-title-container"><a class="map-page-link map-title-link" href="#"><h4 class="map-page-title"></h4></a></div>
                 <div class="map-page-content">  </div>
+
 <!--
                <map id="community-map-nav" name="community-map-nav">
                         <area shape="poly" coords="174,160,177,159,177,170,180,172,181,170,182,172,185,172,185,178,178,178,177,202,174,202,162,190,157,190,158,185,148,186,148,181,141,182,141,176,152,169,150,167,148,163,145,161,144,157,143,154,143,147,145,144,151,140,154,137,160,136,168,140,172,144,174,150,174,156,174,158" data-id="273" alt="petoskey" nohref="nohref" onclick="get_id(this);"/>
         </ul>
     </li>
 </ul>
-<?php 
+<?php
     $nav_args = array(
     'post_type' => 'page',
     'post__in' => array(276,275,274,273,983,981,985),
-    'posts_per_page' => -1, 
+    'posts_per_page' => -1,
     'numberposts' => -1
 //    'post__in' => array(69,71,73,75, 77, 79)
 );
@@ -59,10 +61,10 @@ foreach ($nav_posts as $p){
     $sites[$p->ID]['image'] = wp_get_attachment_url( get_post_thumbnail_id($p->ID));
 //    $sites[$p->ID]['content'] = substr(strip_tags($page_object->post_content),0, 300) . "...";
     $filter_content = substr(strip_tags($page_object->post_content),0, 300) . "...";
-    $filter_content = strip_shortcodes($filter_content); 
-    $sites[$p->ID]['content'] = $filter_content; 
-    
-    
+    $filter_content = strip_shortcodes($filter_content);
+    $sites[$p->ID]['content'] = $filter_content;
+
+
 }
     $js_sites = json_encode($sites);
 //echo '<pre>', print_r($sites) , '</pre>';
@@ -70,7 +72,7 @@ foreach ($nav_posts as $p){
 
 <script type="text/javascript">
     jQuery(document).ready( function ($) {
-        
+
         var site_array = <?php echo $js_sites ?>;
         var id, fill, classes, target_class;
         var region = $('.region-hover');
@@ -79,34 +81,34 @@ foreach ($nav_posts as $p){
         var default_content = <?php echo $community_page_content ?>;
         var region_text = $(".region-text");
 
-       
+
         // set the default data next to the dropdown community map
         function set_default_data(){
             regionData.find(".map-page-title").html('<?php echo $community_page_object->post_title; ?>');
             regionData.find(".map-image-container").css("height","175px").css("width", "300px").css("background", "url('   <?php echo $community_page_image; ?>  ')no-repeat center center").css("background-position", "cover");
             regionData.find(".map-page-content").html(default_content);
         }
-        
+
         $(community_link).find("li").mouseenter( function () {
-           set_default_data(); 
+           set_default_data();
         });
         $(community_link).find(".dropdown").mouseleave( function () {
             set_default_data();
         });
-        
+
         // hover effects and data collection
         $(region).hover( function (){
-            
+
             fill = $(this).attr("fill");
             classes = $(this).attr("class").split(' ');
             target_class = classes[0];
-            
+
             $("." + target_class + ".text-container").attr("opacity", "0.6");
-            
+
             $('.' + target_class).not(".region-text").css("stroke", 'white').css("stroke-width", "2px");
-        
+
             id = $(this).attr("data-id");
-            
+
             regionData.find(".map-page-link").attr("href", site_array[id]['url']);
             regionData.find(".map-page-title").html(site_array[id]['title']);
             regionData.find(".map-image-container").css("height","175px").css("width", "300px").css("background", "url('" + site_array[id]['image'] + "')no-repeat center center").css("background-position", "cover");
@@ -117,14 +119,13 @@ foreach ($nav_posts as $p){
             $("." + target_class + ".text-container").attr("opacity", "1");
             $('.' + target_class).css("stroke-width", "0px");
         });
-        
+
         $(region).on("click", function (){
             window.location.href = site_array[id]['url'];
-            
+
         });
-        
-        
+
+
     });
-   
-</script>
 
+</script>