• Resolved tonym2017

    (@tonym2017)


    I am not sure what is causing this problem as everything used to work fine.

    I generate a map for a place post that incorporates data fields contained in the post.

    The map generates fine and the map icon displays in the correct position but the icon name no longer translates.

    
    [leaflet-map zoom=[types field='map-zoom-level' output='raw'][/types] lat=[types field='map-latitude' output='raw'][/types] lng=[types field='map-longitude' output='raw'][/types] zoomcontrol="1" scrollwheel="0" dragging=true height="500"]
    [leaflet-marker lat=[types field='map-latitude' output='raw'][/types] lng=[types field='map-longitude' output='raw'][/types]][wpv-post-title][/leaflet-marker]
    

    If I click the icon then [wpv-post-title] is displayed instead of the post name.

    It seems that as soon as I make a change to the leaflet marker code (or create a new marker) the short code is not executed.

    Thanks
    Tony

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter tonym2017

    (@tonym2017)

    Just to add, a similar post translates the shortcode correctly:

    http://www.teesdalelocal.co.uk/organisation-venue/eggleston-village-hall/

    I am sure altering the code will cause it to stop working.

    Plugin Author bozdoz

    (@bozdoz)

    I don’t know enough about those [types] shortcodes. What are they outputting? Can you test those? Which plugin is producing that?

    Thread Starter tonym2017

    (@tonym2017)

    Thanks for your speedy reply.

    I use Types and Views plugins.

    They are used to format web pages inserting content via shortcodes.

    So, for example lat=[types field=’map-latitude’ output=’raw’] selects the latitude from the field in the custom post.

    It all works fine except in the [leaflet-marker][/leaflet-marker] line where the required field content [wpv-post-title] is not selected. [wpv-post-title] is the title of the custom post.

    For some reason the translation of [wpv-post-title] to the actual post title is being suppressed.

    Tony

    Plugin Author bozdoz

    (@bozdoz)

    ah, could be how I’m handling popups within the shortcode content.

    See here: https://github.com/bozdoz/wp-plugin-leaflet-map/blob/master/class.leaflet-map.php#L306-L336

    you could try inline:

    [leaflet-marker message=[wpv-post-title]]

    Alternatively, I might have to add a filter to this function to optionally omit str_replace, htmlspecialchars, and the js `unescape’ function.

    Thread Starter tonym2017

    (@tonym2017)

    That works:

    
    [leaflet-marker lat=[types field='map-latitude' output='raw'][/types] lng=[types field='map-longitude' output='raw'][/types] message=[wpv-post-title]]
    

    Excellent.

    Thank you.
    Tony

    Thread Starter tonym2017

    (@tonym2017)

    There was one problem with using message=[wpv-post-title].

    It only selects the first word so I changed the code to message=”[wpv-post-title]”

    Tony

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

The topic ‘[leaflet-marker] short code stopped working’ is closed to new replies.