Skip Navigation

[Resolved] Shortcode around Google Maps (borlabs-cookie)

This support ticket is created 4 years, 6 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 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Hong_Kong (GMT+08:00)

This topic contains 5 replies, has 2 voices.

Last updated by Luo Yang 4 years, 6 months ago.

Assisted by: Luo Yang.

Author
Posts
#1631249

Tell us what you are trying to do?
I want to build [borlabs-cookie id="googlemaps" type="cookie"]...block this...[/borlabs-cookie] around every map.
So that the map functions are loaded AFTER the visitor has agreed.
How do I realize this with Toolset?
In the course of the GDPR this must be done.

Is there any documentation that you are following?
nope

Is there a similar example that we can see?
hidden link

What is the link to your site?
hidden link

#1631459

Hello,

You can setup the Toolset Map shortcode by following our document:
https://toolset.com/documentation/user-guides/maps/maps-shortcodes/#wpv-map-render

You can also switch to classic editor, and generate the map shortcode, see our document:
https://toolset.com/documentation/user-guides/maps/display-on-google-maps/

Then display the map shortcode within your custom shortcode, for example:
[borlabs-cookie id="googlemaps" type="cookie"]
...put the map shortcode here ...
[/borlabs-cookie]

#1635733

If I add my shortcode in the code editor, it will be deleted again.
Is there no way to save a block, and then insert it, which
[borlabs cookie id="googlemaps" type="cookie"]
...put the map shortcode here...
[/borlabs-cookie]
contains? This is a very comprehensive site hidden link
which I didn't really want to build via code editor, but just wanted to tell this maps part, that it will be loaded only after confirmation by the customer.
Is there no Option to add this via Blocks ?

#1636819

What is "code editor" you mentioned above?

In WordPress built-in block editor, you can try with shortcode block, see WP document:
hidden link

#1637769
code-editor.jpg
result.jpg

Hi Luo,

This is my Maps-Code from the Code-Editor that you see in attachement.

<!-- wp:shortcode -->
[borlabs cookie id="googlemaps" type="cookie"][wpv-map-render map_id="map-overzicht"][wpv-map-marker map_id="map-overzicht" marker_id="marker-overzicht" marker_field="wpcf-postcode-en-plaats"][/wpv-map-marker][/borlabs-cookie]
<!-- /wp:shortcode -->

<!-- wp:toolset-blocks/container {"style":{"background":{"type":"solid","solid":{"color":{}},"gradient":{"colors":[{"rgb":{"r":0,"g":0,"b":0,"a":1}},{"rgb":{"r":255,"g":255,"b":255,"a":1}}],"type":"linear"},"image":{"horizontal":{},"vertical":{}}},"margin":{"enabled":true,"marginBottom":"30px"},"padding":{"enabled":true,"paddingTop":"10px","paddingLeft":"10px","paddingRight":"10px","paddingBottom":"10px"},"border":{"top":{"style":"solid","width":1,"widthUnit":"px","color":{"hex":"#e0011b","rgb":{"r":224,"g":1,"b":27,"a":1},"color":{"_originalInput":"#e0011b","_r":224,"_g":1,"_b":27,"_a":1,"_roundA":1,"_format":"hex","_ok":true,"_tc_id":34},"hsl":{"h":353,"s":99,"l":44,"a":1},"hsv":{"h":353,"s":100,"v":88,"a":1},"oldHue":353,"source":"hex"}},"right":{"style":"solid","width":0,"widthUnit":"px","color":{"hex":"#e0011b","rgb":{"r":224,"g":1,"b":27,"a":1},"color":{"_originalInput":"#e0011b","_r":224,"_g":1,"_b":27,"_a":1,"_roundA":1,"_format":"hex","_ok":true,"_tc_id":34},"hsl":{"h":353,"s":99,"l":44,"a":1},"hsv":{"h":353,"s":100,"v":88,"a":1},"oldHue":353,"source":"hex"}},"bottom":{"style":"solid","width":1,"widthUnit":"px","color":{"hex":"#e0011b","rgb":{"r":224,"g":1,"b":27,"a":1},"color":{"_originalInput":"#e0011b","_r":224,"_g":1,"_b":27,"_a":1,"_roundA":1,"_format":"hex","_ok":true,"_tc_id":34},"hsl":{"h":353,"s":99,"l":44,"a":1},"hsv":{"h":353,"s":100,"v":88,"a":1},"oldHue":353,"source":"hex"}},"left":{"style":"solid","width":0,"widthUnit":"px","color":{"hex":"#e0011b","rgb":{"r":224,"g":1,"b":27,"a":1},"color":{"_originalInput":"#e0011b","_r":224,"_g":1,"_b":27,"_a":1,"_roundA":1,"_format":"hex","_ok":true,"_tc_id":34},"hsl":{"h":353,"s":99,"l":44,"a":1},"hsv":{"h":353,"s":100,"v":88,"a":1},"oldHue":353,"source":"hex"}}},"borderRadius":{"topLeft":20,"topRight":20,"bottomLeft":20,"bottomRight":20},"verticalAlign":"middle","display":true}} -->
<div class="wp-block-toolset-blocks-container tb-container" data-toolset-blocks-container="1"><!-- wp:toolset/map {"mapId":"map-overzicht","mapHeight":"350px","mapMarkerClustering":true,"mapMarkerSpiderfying":true,"mapStreetViewControl":false,"mapLoadingText":"Kaart wordt geladen .. Aub even wachten","mapMarkerIconUseDifferentForHover":true,"mapMarkerIconHover":"//www.wensrecruiting.nl/wp-content/plugins/toolset-maps/resources/images/markers/Home.png","markerId":"[\u0022marker-overzicht\u0022]","markerSource":"[\u0022view\u0022]","popupContent":"[\u0022\u003cp\u003e{{wpv-post-title output='sanitize'}}\u003c/p\u003e\u003cp\u003e{{types field='postcode-en-plaats'}}{{/types}}\u003c/p\u003e\u003cp\u003e{{wpv-post-read-more label='Graag meer lezen'}}\u003c/p\u003e\u0022]","markerView":"[575]","markerPreviewView":"[577]","markerViewField":"[\u0022wpcf-postcode-en-plaats\u0022]"} /--></div>
<!-- /wp:toolset-blocks/container -->

But The Shortcode will not be rendered. See result.jpg

Have you a Hint, what i am doing wrong ?

The Fields are in Loop, because the:

<div class="wp-block-toolset-blocks-container tb-container" data-toolset-blocks-container="1"><!-- wp:toolset/map {"mapId":"map-overzicht","mapHeight":"350px","mapMarkerClustering":true,"mapMarkerSpiderfying":true,"mapStreetViewControl":false,"mapLoadingText":"Kaart wordt geladen .. Aub even wachten","mapMarkerIconUseDifferentForHover":true,"mapMarkerIconHover":"//www.wensrecruiting.nl/wp-content/plugins/toolset-maps/resources/images/markers/Home.png","markerId":"[\u0022marker-overzicht\u0022]","markerSource":"[\u0022view\u0022]","popupContent":"[\u0022\u003cp\u003e{{wpv-post-title output='sanitize'}}\u003c/p\u003e\u003cp\u003e{{types field='postcode-en-plaats'}}{{/types}}\u003c/p\u003e\u003cp\u003e{{wpv-post-read-more label='Graag meer lezen'}}\u003c/p\u003e\u0022]","markerView":"[575]","markerPreviewView":"[577]","markerViewField":"[\u0022wpcf-postcode-en-plaats\u0022]"} /--></div>

will be rendered normally.

It must be possible for the toolset to be GDPR compliant with maps and the visitor must first click before data is transferred to Google... Or not?

Many Thanks for Your Help.

Regardful
Maik

#1638195

It depends on your custom shortcode [borlabs] ... [/borlabs].

You can check if it is compatible with other simple shortcodes, for example:
[borlabs] [wpv-post-title] [/borlabs]

If it does not work too, then it does not support shortcode within shortcode feature, you might need to create other custom shortcode for it.

More help:
https://developer.wordpress.org/reference/functions/add_shortcode
Adds a new shortcode.