Skip Navigation

[Resolved] maps popup editor is misbehaving

This support ticket is created 3 years, 4 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
- 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 3 replies, has 2 voices.

Last updated by Alexander Rothschild 3 years, 4 months ago.

Assisted by: Minesh.

Author
Posts
#2146327
Screenshot 2021-08-19 105209.jpg
Untitled.jpg
Screenshot 2021-08-19 105148.jpg
Screenshot 2021-08-19 105333.jpg

Hi,

I have a custom post type that has two fields - url and a label for that url. I can use Toolset Text and Fields block to generate a simple link: Label. And it works as expected.

The problem arises when I try to do the same in Maps Popup Editor. I tried using the wizard and writing code by hand. Tried the RAW mode and the other mode. The link always comes out jumbled...

Hoping the popup editor could behave just as nice as Text and Fields Block editor... Any workarounds I could use now? The goal is to show the label over the url.

#2146569

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

This issue is known to us and already escalated to Devs but there in no ETA on it when the fix will be provided.

As a workaround, you should try to create a shortcode that should display return the link and check if that helps you to resolve your issue.

#2146745

Minesh
Supporter

Languages: English (English )

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

Here is the errata page we publish:
- https://toolset.com/errata/cannot-use-types-shortcode-as-html-attribute-value-in-maps-pop-up/

You should try to use the workaround shared with the above errata page.

#2147315

Thank you Minesh.

The shortcode is working fine. Here's the code I ended up using:

add_shortcode('render-link', 'render_link_shortcode');

function render_link_shortcode($atts) {

  global $post;
  
  $url = get_post_meta($post->ID, 'wpcf-'.$atts['field'], true );
  $label = str_ireplace('www.', '', parse_url($url, PHP_URL_HOST));
  
  return empty($url) ? "" : "<a href='{$url}' target='_blank'>{$label}</a>";
}