Jump to content

PrivacyWire - Cookie Management & async external asset loading


joshua

Recommended Posts

not sure whether a feature request should be dropped here, or @github, but I'll try it here first 😉

First off: I love that module. It's handy, easy to implement/adapt and it just does what it is supposed to do. Thanks for sharing!

What I was looking for is a way to customize the markup of the consent blueprint. For the time being I have edited the original shipped file, but actually it would be great if this file can be configured the same way as the banner. Maybe that's something you could consider in the future as well? 

 

/update

🙂 https://github.com/webworkerJoshua/privacywire/pull/16

  • Like 2
Link to comment
Share on other sites

  • 1 month later...

@joshua I'm using GoogleMapsApi on a page. And did this:
 

<?php

// allow button
echo "<a class='privacywire-consent-button' data-consent-category='external_media'>allow cookies</a>";

	$address = $content->map_address->address;
	$lat = $content->map_address->lat;
	$lng = $content->map_address->lng;
	echo "<script >
		var lat,lng,zoom;
		lat = $lat;
		lng = $lng;
	</script>";	
		
// map stylung and render function
echo "<script type='text/plain' data-type='text/javascript' data-category='external_media'  data-src='{$templatesUrl}scripts/gmaps.js' class='require-consent'></script>";

// maps API
echo "<script type='text/plain' data-type='text/javascript' data-category='external_media' data-src='https://maps.googleapis.com/maps/api/js?key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXX&callback=initMap' class='require-consent'></script>";
	
// my map
echo "<div id='map' class='wrapper'></div>";

When I click on the allow button, all content disappear and there is a error
 

domain.com/:1 Uncaught (in promise) Qe {message: 'Map: Expected mapDiv of type HTMLElement but was passed null …

However the cookies are allowed. So that if refresh the page, everything is fine (cookies allowed and map is shown). What am I missing?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...