I am trying to add references to external JS/CSS files, and for the most of them, all works fine. However as soon as I try and add an external script with parameters in the URL (for example &sensor=false&libraries=geometry
), it seems to cause issues. In my case, it's causing Google maps not to detect the API key. I tried replacing the &
with %26
, but this didn't work.
Adding the script directly into the template works, just not through the XML, which is what I need in this case.
XML
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd" layout="1column">
<head>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/redmond/jquery-ui.min.css" src_type="url"/>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js" src_type="url"/>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js" src_type="url"/>
<script src="https://maps.google.com/maps/api/js?key=MYAPIKEY&sensor=false&libraries=geometry" src_type="url"/>
</head>
</page>