I'm trying to override lib/web/mage/adminhtml/browser.js in my module.
here is my Company/CampaignPopup/view/frontend/requirejs-config.js
var config = {
map: {
"*": {
'browser':'Company_CampaignPopup/js/adminhtml/browser-custom',
'adminhtml/browser':'Company_CampaignPopup/js/adminhtml/browser-custom',
'mage/adminhtml/browser': 'Company_CampaignPopup/js/adminhtml/browser-custom'
}
}
};
I was trying all this paths.
-
Did you find any solution?ND17– ND172017年07月18日 07:46:51 +00:00Commented Jul 18, 2017 at 7:46
1 Answer 1
Try following code:
- app/code/[VendorName]/[ModuleName]/registration.php
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::MODULE,
'[VendorName]_[ModuleName]',
__DIR__
);
- app/code/[VendorName]/[ModuleName]/etc/module.xml
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="[VendorName]_[ModuleName]" setup_version="1.0.0">
<sequence>
<module name="Magento_Theme"/>
</sequence>
</module>
</config>
- app/code/[VendorName]/[ModuleName]/etc/di.xml
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Magento\Theme\Model\View\Design">
<arguments>
<argument name="themes" xsi:type="array">
<item name="adminhtml" xsi:type="string">[VendorName]/[themename]</item>
</argument>
</arguments>
</type>
</config>
- app/design/adminhtml/[VendorName]/[themename]/registration.php
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::THEME,
'adminhtml/[VendorName]/[themename]',
__DIR__
);
- app/design/adminhtml/[VendorName]/[themename]/theme.xml
<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
<title>Theme Title</title>
<parent>Magento/backend</parent>
</theme>
- app/design/adminhtml/[VendorName]/[themename]/requirejs-config.js
var config = {
map: {
'*': {
'mage/adminhtml/browser':'mage/adminhtml/custom-browser'
}
}
};
- app/design/adminhtml/[VendorName]/[themename]/web/mage/adminhtml/custom-browser.js
answered Dec 22, 2017 at 19:12
Pratik Oza
4,00212 silver badges17 bronze badges
-
Doesn't look like to work on Magento 2.4.2. Got static compilation error.Sylvain Rayé– Sylvain Rayé2021年03月17日 15:45:18 +00:00Commented Mar 17, 2021 at 15:45
default