Map Bubble Without Hyperlink?

This topic contains 5 replies, has 2 voices, and was last updated by  Paolo 8 years, 4 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #67918

    Tim
    Buyer
    Post count: 8

    I’m currently creating a very basic map using geodirectory basically just pins in a map with the location name in the bubble, doesn’t needs to anything else (except I need the option to use a custom pin which is why I am using this for such a simple map). I’ve already used css (listed below) to hide most of the things in the bubble so that I am only left with the title of the location on a smaller sized bubble.

    Firstly there still seems to be a lot of blank white space in the bubble below the title (the css relating to the title itself seems to only take up the top half of the bubble, not sure what is spacing out the bottom half), I can’t work out what is causing this, any guidance on any css i’ve missed would be appreciated.

    Also is there a way of removing the hyperlink from the location title in the bubble while keeping the title itself? There is no need for visitors to see the listings pages themselves, in fact these will hold no info as so the preference is not for visitors to be able to click on the hyperlink and visit page as they will basically end up looking at a nearly blank page!!

    CSS used so far:
    .geodir-bubble_image {
    display: none;
    }

    .geodir-bubble-meta-side {
    display: none;
    }

    .geodir-bubble-meta-fade {
    display: none;
    }

    .geodir-bubble-meta-bottom {
    display: none;
    }

    .geodir-bubble_image {
    display: none;
    }

    .gd-bubble {
    max-width: 150px;
    width: 80px;
    overflow: visible;
    }

    .geodir-bubble_desc {
    width: 80px !important;
    overflow-y: hidden;
    }

    .geodir-bubble_desc h4 {
    background: transparent;
    }

    .geodir-bubble_desc h4 a {
    background: transparent;
    }

    .map-category-listing {
    display: none;
    }

    .geodir-breadcrumb {
    display: none;
    }

    .geodir-addinfo {
    display: none;
    }

    #68000

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    The bubble minimum size is imposed by Google Maps CSS inline and can’t be overriden.

    To unlink the title please try this:

    
    
    function my_remove_bubble_title($html, $postinfo_obj, $post_preview){
            $srcharr = array("'", "/", "-", '"', '\');
            $replarr = array("′", "⁄", "–", "“", '');
    
        if (isset($postinfo_obj->post_id)) {
            $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>';
    
            $html = str_replace($link,"",$html);
        }
    
    return $html;
    }
    add_filter('geodir_custom_infowindow_html','my_remove_bubble_title',10,3);

    Let us know if it helped.

    Thanks

    #68480

    Tim
    Buyer
    Post count: 8

    Thanks for the swift response.

    I’ve placed this in the functions.php field which I think is correct, though I not that familar with functions yet. Although this does remove the hyperlink it also removes the title also so all I am left with is a white box. I would like the box to still contain the name, eg Staines in the attached example, but for this to just be text and not hyperlink to the place page.

    Thanks

    #68793

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    in that case we misunderstood the question, please try this instead:

    
    
    function my_remove_bubble_title($html, $postinfo_obj, $post_preview){
            $srcharr = array("'", "/", "-", '"', '\');
            $replarr = array("&prime;", "&frasl;", "&ndash;", "&ldquo;", '');
    
        if (isset($postinfo_obj->post_id)) {
            $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>';
    
            $html = str_replace($link,$title,$html);
        }
    
    return $html;
    }
    add_filter('geodir_custom_infowindow_html','my_remove_bubble_title',10,3);

    Let us know,

    Thanks

    #68822

    Tim
    Buyer
    Post count: 8

    Thats fantastic, that works perfectly.

    Many thanks

    #68825

    Paolo
    Site Admin
    Post count: 31206

    You are welcome 🙂

Viewing 6 posts - 1 through 6 (of 6 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket