Skip Navigation

[Resolved] Cannot have a popup in map link to google maps

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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 4 replies, has 1 voice.

Last updated by Minesh 2 weeks, 4 days ago.

Assisted by: Minesh.

Author
Posts
#2786589

An example page is:
hidden link
As you can see I can form correctly the url (I put it for debug purposes just over the map.
I formed the code for the popup accordingly:

The shortcode part is highlighted in yellow and it is nor resolved.
What am I doing wrong?
Maybe I need to escape the ' ?

BTW If only I could use the standard popup behaviour working on all other POIs on the map!!!

#2786591

a href='hidden link field=\'place\' output=\'raw\'][/types]' title='Apri google maps'>Apri google maps</a
is the snippet of code. I put out the < and > to make it readable. As you can see it doesn't work also escaping

#2786592

OK I've found a workaround... writing it here for the sake of future users:
Create a custom shortcode and put in functions.php.

function generate_google_maps_link($atts) {
// Estrai i parametri dello shortcode, se necessario
$atts = shortcode_atts(
array(
'field' => 'place', // Campo di default
),
$atts,
'google_maps_link'
);

// Recupera il valore del campo 'place' usando Toolset Types API
if (function_exists('types_render_field')) {
$place = types_render_field($atts['field'], array('output' => 'raw'));
} else {
$place = '';
}

// Controlla se il campo è vuoto
if (empty($place)) {
return '<p>Campo non disponibile</p>';
}

// Genera l'HTML del link
$html = "";

return $html;
}
add_shortcode('google_maps_link', 'generate_google_maps_link');


Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

It seems you already find the solution for your issue. You're welcome to close the ticket.