Navigation überspringen

[Gelöst] Cannot have a popup in map link to google maps

This support ticket is created vor 1 year, 5 months. 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
- 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 -

Zeitzone des Unterstützers: Asia/Kolkata (GMT+05:30)

Dieses Thema enthält 4 Antworten, hat 1 Stimme.

Zuletzt aktualisiert von Minesh vor 1 year, 5 months.

Assistiert von: Minesh.

Author
Artikel
#2786589

An example page is:
versteckter 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:
versteckter Link
The shortcode part is highlighted in yellow and it is nor resolved.
What am I doing wrong?
Maybe I need to escape the ' ?

#2786590

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

#2786591

a href='versteckter 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 = "versteckter Link";

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

#2786647

Minesh
Unterstützer

Sprachen: Englisch (English )

Zeitzone: 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.