• Resolved mjnswp

    (@mjnswp)


    Hey, the HTML inside my marker popups suddenly stopped working. it was fine couple days ago, but now only raw text is being output.

    my marker code, inside a single custom post type page. variables are filled with advanced custom fields data. everything is fine, except the missing HTML inside the popup.

    echo do_shortcode('[leaflet-marker address="'.$veranstaltungsadresse.'" svg background="'.$farbcode.'"]<h4 class="infobox_title">'.get_the_title().'</h4><div style="font-size:1.4rem;margin-bottom:1rem;">'.$veranstaltungsadresse.'</div>[/leaflet-marker]');

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor hupe13

    (@hupe13)

    It works on my test page.

    it was fine couple days ago, but now only raw text is being output.

    What has changed on your installation? php version, a plugin, WordPress version, your script?
    I’m using Query Monitor and the Developer Console to debug. And define('WP_DEBUG', true);.

    Thread Starter mjnswp

    (@mjnswp)

    the problem seems to be the content blocker from Real Cookie Banner. do you think there’s a way you could help me make it work?

    Plugin Contributor hupe13

    (@hupe13)

    I scanned my testing site with this (free) plugin. It detects OpenStreetMap, but it handles this in the pro version only.
    I wrote my own DSGVO plugin, maybe it is enough for your site. You don’t need the Extensions to make it work.

    P.S. Or ask the support of Real Cookie Banner.

    • This reply was modified 3 years, 7 months ago by hupe13.
    Thread Starter mjnswp

    (@mjnswp)

    yeah seems like a Real Cookie Banner problem. thanks for your reply anyways!

    if anyone else comes across this problem. it’s working if I wrap the popup html in htmlspecialchars().
    but get_the_permalink was giving me errors, so I also had to cut the permalink and only use the path, like:

    
    // cut permalink
    $postlink = get_the_permalink();
    $postlinkPath = parse_url($postlink)['path'];
    
    // marker popup html in variable
    $markerPopupContent = '<span class="infobox_ort">'.$acf_field_ort.'</span><h4 class="infobox_title">'.get_the_title().'</h4><div style="font-size:1.4rem;margin-bottom:1rem;">'.$acf_field_veranstaltungsadresse.'</div><a href="'.$postlinkPath.'" class="button inView" style="background-color:'.$acf_field_farbcode.';">Info</a>';
    
    // output popup variable with htmlspecialchars()
    echo do_shortcode('[leaflet-marker address="'.$acf_field_veranstaltungsadresse.'" svg background="'.$acf_field_farbcode.'"]'.htmlspecialchars($markerPopupContent).'[/leaflet-marker]');

    Have you tried :
    with get_post_permalink()

    • This reply was modified 3 years, 4 months ago by Bob333.
Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘HTML inside Marker-Popup’ is closed to new replies.