Also ich habe es nach Deiner Anleitung umgesetzt. In meiner script_trackingcode.html steht folgendes:
Code:
<script>
var mymap = L.map('mapid').setView([<?= $this->latitude; ?>, <?= $this->longitude; ?>], 13);
L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw', {
maxZoom: 18,
id: 'mapbox.streets'
}).addTo(mymap);
L.marker([0, 0]).addTo(mymap);
</script>
und mit meinem rsce Template folgendes:
Code:
<?php
$template = new \Contao\FrontendTemplate('script_trackingcode');
$template->setData($this->arrData = $arrData);
$GLOBALS['TL_BODY'][] = $template->parse();
?>
Die Werte der beiden Variablen '<?= $this->latitude; ?>' und '<?= $this->longitude; ?>' werden nicht übergeben.
Was mache ich falsch?
Lesezeichen