{"id":807,"date":"2019-06-04T05:31:44","date_gmt":"2019-06-04T05:31:44","guid":{"rendered":"https:\/\/wpgeodirectory.com\/docs-v2\/?post_type=docs&#038;p=807"},"modified":"2019-06-04T05:44:30","modified_gmt":"2019-06-04T05:44:30","slug":"map-bubble","status":"publish","type":"docs","link":"https:\/\/wpgeodirectory.com\/docs-v2\/templates\/map-bubble\/","title":{"rendered":"Map Bubble"},"content":{"rendered":"<p><span class='bookmark-index'><br \/>\n<a href=\"#intro\">Introduction<\/a><br \/>\n<a href=\"#troubleshooting\">Troubleshooting<\/a><br \/>\n<a href=\"#faq\">Frequently Asked Questions<\/a><br \/>\n<a href=\"#support\">Support<\/a><br \/>\n<\/span><\/p>\n<h3><a name=\"intro\" href=\"#intro\">Introduction<\/a><\/h3>\n<h4>What<\/h4>\n<p>The Map Bubble is the small box\/bubble that pops up when you click on a map icon on the map.<\/p>\n<p>Data shown in the map bubble is displayed with the default options for GD Post Meta.<\/p>\n<p>That means that when a field is chosen for display in the map bubble, it is always displayed with &#8220;icon+label+value&#8221;.<\/p>\n<h3>Personalize<\/h3>\n<h4>Show in extra locations<\/h4>\n<p>Use the custom fields setting &#8220;Show in extra location&#8221; to show a field in the map bubble.<\/p>\n<p><strong>CPT Settings (ex. Places Settings) &#8211; General (tab) &#8211; Show Advanced &#8211; Details template &#8211; Choose your template page<\/strong><\/p>\n<h3>Customize<\/h3>\n<p>See our doc about <a href=\"https:\/\/wpgeodirectory.com\/docs-v2\/faq\/customizing\/\">customizing<\/a> for instructions on using code snippets.<\/p>\n<h4><a href=\"#css\" name=\"css\">Custom CSS<\/a><\/h4>\n<p>Map Bubble templates can be customized with Custom CSS<\/p>\n<p>To hide the label for a field shown in the map bubble, create custom CSS like this:<\/p>\n<pre><code class='css'>\r\n.gd-bubble span.geodir_post_meta_title {\r\n    display: none;\r\n}\r\n<\/code><\/pre>\n<p>To hide the icon for a field shown in the map bubble, create custom CSS like this:<\/p>\n<pre><code class='css'>\r\n.gd-bubble .geodir_post_meta.geodir-field-post_title .geodir_post_meta_icon.geodir-i-text {\r\n    display: none;\r\n}\r\n<\/code><\/pre>\n<h4>PHP Template<\/h4>\n<p>Want to change the way the map bubble template?<\/p>\n<p>You can see the template here: https:\/\/github.com\/AyeCode\/geodirectory\/blob\/master\/templates\/map-popup.php<\/p>\n<p>To customize, create folder \/geodirectory\/ in your theme and copy file \\wp-content\\plugins\\geodirectory\\templates\\map-popup.php into the folder.<br \/>\nThe new file will be YOUR_THEME\/geodirectory\/map-popup.php.<br \/>\nNow edit file YOUR_THEME\/geodirectory\/map-popup.php and remove change the shortcode or other content to meet your needs.<\/p>\n<h4>Map Bubble Address Format<\/h4>\n<p>To change the address format in the map bubble, first remove the settings in the address custom field for &#8220;Show in extra locations -> Map Bubble&#8221;.<br \/>\nThen add the following snippet, adjusting to meet your needs.<\/p>\n<pre><code class='php'>\r\nadd_filter(&quot;geodir_show_listing_info&quot;,&quot;_my_map_address_add&quot;,10,2);\r\nfunction _my_map_address_add($html,$fields_location){\r\n\r\nif($fields_location=='mapbubble'){\r\n$html = do_shortcode('[gd_post_address show=&quot;icon-label-value&quot; address_template=&quot;%%post_title%% %%post_title_br%% :: %%street_br%% %%neighbourhood_br%% %%city_br%% %%region_br%% %%zip_br%% %%country%%&quot;]').$html;\r\n}\r\n    return $html;\r\n}\r\n<\/code><\/pre>\n","protected":false},"featured_media":0,"parent":683,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","doc_tag":[],"amp_validity":null,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/wpgeodirectory.com\/docs-v2\/wp-json\/wp\/v2\/docs\/807"}],"collection":[{"href":"https:\/\/wpgeodirectory.com\/docs-v2\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/wpgeodirectory.com\/docs-v2\/wp-json\/wp\/v2\/types\/docs"}],"replies":[{"embeddable":true,"href":"https:\/\/wpgeodirectory.com\/docs-v2\/wp-json\/wp\/v2\/comments?post=807"}],"version-history":[{"count":0,"href":"https:\/\/wpgeodirectory.com\/docs-v2\/wp-json\/wp\/v2\/docs\/807\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/wpgeodirectory.com\/docs-v2\/wp-json\/wp\/v2\/docs\/683"}],"next":[{"title":"Archive Item Template","link":"https:\/\/wpgeodirectory.com\/docs-v2\/templates\/archive-item\/","href":"https:\/\/wpgeodirectory.com\/docs-v2\/wp-json\/wp\/v2\/docs\/712"}],"wp:attachment":[{"href":"https:\/\/wpgeodirectory.com\/docs-v2\/wp-json\/wp\/v2\/media?parent=807"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/docs-v2\/wp-json\/wp\/v2\/doc_tag?post=807"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}