Skip Navigation

[Resolved] wpv-map-render doesn't render properly with do_shortcode

This support ticket is created 5 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 8 replies, has 2 voices.

Last updated by laetitiat 5 years, 11 months ago.

Assisted by: Shane.

Author
Posts
#892529

Hi,

I'm trying to display a map directly in a custom page template like :

...
echo do_shortcode ('[wpv-map-render map_id="map-1" map_width="100%" map_height="180" fitbounds="on" general_zoom="4" single_center="on" cluster="on" draggable="on" double_click_zoom="on" map_type_control="on" street_view_control="on" zoom_control="on"][/wpv-map-render]');

echo do_shortcode ('[wpv-map-marker map_id="map-1" marker_id="marker-1" marker_field="wpcf-address"][/wpv-map-marker]');
...

This code displays correctly the map and marker but doesn't show any button (zoom+, zoom -, etc...) so I can't navigate in the map.

I don't understand what I am missing ?

Thank you for your help.

#894325

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

Thank you for contacting our support forum.

It seems that our team is already aware of this issue and have publish and errata page on it.

Could you try the solution here and let me know the results.

https://toolset.com/forums/topic/wpv-map-render-doesnt-render-properly-with-do_shortcode/

Thanks,
Shane

#894328

Hi Shane,

Thanks for your answer but I can't find the solution : the link that you gave me is the link of the actual page.
Can you send me the link of the solution page ?

Thank you very much

#894611

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

Sorry for the confusion.

Here is the correct link.
https://toolset.com/errata/unexpected-input-when-shortcode-with-id-attribute-is-rendered-using-php/

Thanks,
Shane

#895880

Hi Shane,

Thank you for your reply but the solution is :

"Do not use ShortCodes when you call parent data with PHP, instead use the API to create a custom ShortCode to return the same values or echo the API directly if needed/possible."

If I can't use do_shortcode(), can you explain to me how can I create a custom shortcode to replace wpv-map-render and wpv-map-marker ?

Thanks

#897944

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

Is there a reason why you would like to load this directly from the php template?

Perhaps I could provide an alternate solution based on the scenario.

Please let me know.
Thanks,
Shane

#899852

Hello,

I'm using a specific page template from my them, I'm integrating a map directly in the template, I'm not using View for this.

It seems like you don't have a solution for this issue.

Regards

#901191

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

What I would need to do in this case is escalate your ticket for assistance from our second tier supporters because i'm not aware of an API that can render the map directly on the template without the do_shortcode function.

Once I get any information then I will let you know.

Thanks,
Shane

#901242

Hi Shane,

Thank for your help and time, I found the error, maps need to have a min-height = 200px to display button control....

do_shortcode() works correctly with the shortcodes wpv-map-render & wpv-map-marker

Regards

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.