Ich versuche, default_head_blocks.xml wie unten beschrieben zu überschreiben
Vendor \ Magento \ Modul-Theme \ View \ Frontend \ Layout \ Default_head_blocks.xml
<?xml version="1.0"?>
<!--
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<css src="mage/calendar.css"/>
<script src="requirejs/require.js"/>
</head>
<body>
<referenceContainer name="after.body.start">
<block class="Magento\Framework\View\Element\Js\Components" name="head.components" as="components" template="Magento_Theme::js/components.phtml" before="-"/>
</referenceContainer>
</body>
</page>
app \ design \ frontend \ Enterprise \ Orange \ Magento_Theme \ layout \ default_head_blocks.xml
<?xml version="1.0"?>
<!--
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link src="js/customercookie.js"/>
<link src="js/customercookie.js"/>
<link src="Orange_Webform::js/mnpform.js"/>
<css src="mage/calendar.css"/>
<css src="common-header/css/custom.css"/>
<script src="shm/shm.js"/>
<script src="common-header/js/custom.js"/>
<script src="requirejs/require.js"/>
</head>
<body>
<referenceContainer name="after.body.start">
<block class="Magento\Framework\View\Element\Js\Components" name="head.components" as="components" template="Magento_Theme::js/components.phtml" before="-"/>
</referenceContainer>
</body>
</page>
Ich möchte nur shm / shm.js vor requirejs / require.js laden
Bitte erledige das Nötige
magento2
magento-2.1
knockoutjs
requirejs
Uthayaselvan
quelle
quelle
Antworten:
Um benutzerdefinierte js vor require.js zu laden, fügen Sie unter dem XML-Pfad benutzerdefinierte js hinzu
app \ design \ frontend \ Enterprise \ Orange \ Magento_Theme \ layout \ override \ base \ default_head_blocks.xml
quelle