Adding Google Maps to page template without a block?

Permalink
I just converted a basic html site to C5's custom theme. Our contact page had a minimal Gmaps that was working nicely, but now the div is just empty?!

I would greatly appreciate if someone pointed me where the problem might be, as I can't see any problem how I couldn't hardcode a little Gmaps to a page...?

Here's the page:
http://xn--jsenkorjaustampere-ltb.fi/yhteystiedot...

eNViSiOn
 
site replied on at Permalink Reply
site
I think its bug with the google maps block and I believe the issue is simply with the caching settings of the block.

I don't usually recommend editing the source, but in this annoying case when it comes up blank after editing it after insertion, I have just edited the /concrete/blocks/google_map/controller.php file and changed in the very beginning of the file the line
protected $btCacheBlockOutputForRegisteredUsers = true;
to
protected $btCacheBlockOutputForRegisteredUsers = false;


NOTE: You must make the above recommend changes to the current working copy of concrete core files. So check in the /updates folder in case there are any folders in there and make the changes to the highest version numbered directory.
Mnkras replied on at Permalink Reply
Mnkras
Here is a good rule,

Rule #1 NEVER edit files in the /updates or /concrete folder,

first copy the files from /updates/updateversion//concrete or /concrete to the top level folders,

eg: /concrete/blocks/google_map/ would be copied to /blocks before you edit it,
eNViSiOn replied on at Permalink Reply
eNViSiOn
As the title tells, this problem is with adding Google maps to theme >without< a block... ;)
Mnkras replied on at Permalink Reply
Mnkras
why not just hardcode the googlemaps block,
eNViSiOn replied on at Permalink Reply
eNViSiOn
Because I already have the map ready and customized map in the HTML code, that I just wan't to concretize. And I don't see where the problem lies when I cannot do so - div is just empty while it was working nicely with HTML?
eNViSiOn replied on at Permalink Best Answer Reply
eNViSiOn
It is done! Seem like I had used my outdated code, that still used onload(); in the body.

It works fine with this code in the head:
<script type="text/javascript" src="http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=false&amp;key=ABQIAAAAmLhf9q4TxB2D0DC6igHCCxRatsdiTEq_mIahFtFzEANnJkLnURR4vYGZJbfm6QTtSNCtYQoHBzY0Wg"></script>
<script type="text/javascript">
$(function() {
   if (GBrowserIsCompatible()) {
     var map = new GMap2(document.getElementById("map_canvas"));
     var point = new GLatLng(61.495032, 23.767086);
     map.setCenter(point, 13);
     map.setUIToDefault();
     map.addOverlay(new GMarker(point));
     map.getContainer().style.overflow="hidden";
   }
});
</script>


Here's the page live:
http://jäsenkorjaustampere.fi/yhteystiedot...

This website stores cookies on your computer. These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media. To find out more about the cookies we use, see our Privacy Policy.