Map icon link
This topic contains 11 replies, has 2 voices, and was last updated by Paolo 9 years, 9 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket-
AuthorPosts
-
January 12, 2016 at 11:08 am #67972
When a map icon is selected, rather than showing the info bubble, I’d like to link directly to the listing’s website (in a new window).
Any help much appreciated.Thanks in advance.
January 12, 2016 at 6:18 pm #68016Hi,
that is not possible, clicking the map marker can only open the infowindow.
Changing that would require a code customization and I’m not even sure that Google Maps script would allow you to do that.
Thanks
January 13, 2016 at 8:46 am #68083Fair enough, thanks for getting back to me.
Any idea how I can change the image link in the bubble to go to the listing’s website rather than the details page?
January 13, 2016 at 5:33 pm #68209Hi,
I’m not sure what is your level of programming, but Stiofan yesterday passed me a function to unlink the listing title in the map bubble.
You can find it here: https://wpgeodirectory.com/support/topic/map-bubble-without-hyperlink/#post-68000
Personally I wouldn’t be able to point you in the right direction to modify it for your needs.
But maybe you don’t need extra pointers?
Let us know,
January 16, 2016 at 1:50 pm #68928Thanks for the link. I’ll have a go but my progranmming skills are limited!
January 16, 2016 at 5:11 pm #68975Let us know how you went, if you can’t get it to work, we can always ask for help to Stiofan.
Thanks
January 16, 2016 at 6:40 pm #69001I’m struggling!
What I’m trying to do is set both the title and image links in the bubble to go to the listing’s website instead of the details page.
Can we ask Stiofan for help please? How do we do that?
January 18, 2016 at 4:01 pm #69214Hi,
this shuold work like this, if there is a website URL in the listing, it will redirect to it, if tere isn’t it will direct to the listing details page normally.
unction my_change_bubble_title($html, $postinfo_obj, $post_preview){ $srcharr = array("'", "/", "-", '"', '\'); $replarr = array("′", "⁄", "–", "“", ''); if (isset($postinfo_obj->geodir_website) && $postinfo_obj->geodir_website) { $ID = $postinfo_obj->post_id; $plink = get_permalink($ID); $title = str_replace($srcharr, $replarr, htmlentities($postinfo_obj->post_title, ENT_COMPAT, 'UTF-8')); $link = '<a href="'.$plink.'">'.$title.'</a>'; $website_link = esc_url($postinfo_obj->geodir_website); $title_link = '<a href="'.$website_link.'">'.$title.'</a>'; $html = str_replace($link,$title_link,$html); } return $html; } add_filter('geodir_custom_infowindow_html','my_change_bubble_title',10,3);Let us know how you went,
Thanks
January 19, 2016 at 10:09 am #69288That’s brilliant, thank you so much, it worked perfectly!
I’d like to do the same for the bubble image link. Is it as simple as replicating this code and replacing $title with $image?
January 19, 2016 at 4:29 pm #69352it isn’t as simple, it is actually a completely different function. This should be considered customizations and if you have many other requests like these, you should be looking for a developer to hire to help you out.
Customizations are beyond support.
Thanks
January 20, 2016 at 4:08 pm #69541I don’t have any other requests, that was the last thing I needed to complete this site.
Anyway, I found another way round the problem.
Thanks again.
January 20, 2016 at 8:40 pm #69632Thanks for letting us know 🙂
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket