i need to add the following in the admin section head tag:

<link rel="manifest" href="/manifest.json" />
<script src="https://cdn.onesignal.com/sdks/OneSignalSDK.js" async=""></script>
  var OneSignal = window.OneSignal || [];
  OneSignal.push(function() {
      appId: "xxxxxxxxxxxxxxxxx",

i know how to add local scripts , but any idea how to add remote scripts?


Try below code in your layout file:

<?xml version="1.0" ?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <script src="https://cdn.onesignal.com/sdks/OneSignalSDK.js" src_type="url"/>
  • THAAAAANK UUU U – Zorox May 14 '18 at 13:57

This will working in 2.2.2 or updated versions.

<?xml version="1.0" encoding="UTF-8"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="vendor-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <title>Your Title</title>
        <css src="Namespace_Modulename::css/component.css"/>
        <link src="Namespace_Modulename::js/custom-file-input.js"/>
        <referenceBlock name="page.main.title">
            <action method="setPageTitle">
                <argument translate="true" name="title" xsi:type="string">Your Title</argument>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.