Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save m-engel/ebfeb3956c3160df608182c3eb194d2e to your computer and use it in GitHub Desktop.
Save m-engel/ebfeb3956c3160df608182c3eb194d2e to your computer and use it in GitHub Desktop.
<?php
// just for specific template
if($resource->get('template') != '3') return true;
$modx->regClientStartupScript('http://maps.googleapis.com/maps/api/js?libraries=places&sensor=true');
$modx->regClientStartupScript('<script type="text/javascript">
Ext.onReady(function() {
var input = document.getElementById("tv10");
var options = {
types: ["(cities)"],
componentRestrictions: {country: "de"}
};
autocomplete = new google.maps.places.Autocomplete(input, options);
});
</script>');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment