0

I'm trying to overwrite the necessary UI elements in my module. I for the input fields I need to have the label behind the input.

Now I know how to overwrite these in my theme but I would like to add them to my module to make it easier to install for future projects.

I know that this should be done with the requirejs-config.js but i'm unsure how.

var config = {
config: {
    mixins: {
        'Magento_Checkout/js/view/shipping': {
            'BB_Checkout/js/mixin/shipping-mixin': true
        }
    }
},
map: {
    '*': {
        'Magento_Ui/view/frontend/web/templates/form/element/input.html': 'BB_Checkout/view/frontend/web/templates/form/element/input.html',
        'Magento_Ui/view/frontend/web/templates/form/element/email.html': 'BB_Checkout/view/frontend/web/templates/form/element/email.html',
        'Magento_Ui/view/frontend/web/templates/form/element/password.html': 'BB_Checkout/view/frontend/web/templates/form/element/password.html',
        'Magento_Ui/view/frontend/web/templates/form/field.html': 'BB_Checkout/view/frontend/web/templates/form/field.html'
    }
}
 };

I currently got this but the part from map: doesn't work. Any idea how I would get this to work? I tried cache cleaning already.

Thanks in advance.

UPDATE

I also tried this but that doesn't work either. Also tried cleaning browser cache.

 map: {
    '*': {
        'Magento_Ui/templates/form/element/input.html': 'BB_Checkout/templates/form/element/input.html',
        'Magento_Ui/templates/form/element/email.html': 'BB_Checkout/templates/form/element/email.html',
        'Magento_Ui/templates/form/element/password.html': 'BB_Checkout/templates/form/element/password.html',
        'Magento_Ui/templates/form/field.html': '/BB_Checkout/templates/form/field.html'
    }
}

I also tried:

 map: {
    '*': {
        'Magento_Ui/templates/form/element/input.html': 'templates/form/element/input.html',
        'Magento_Ui/templates/form/element/email.html': 'templates/form/element/email.html',
        'Magento_Ui/templates/form/element/password.html': 'templates/form/element/password.html',
        'Magento_Ui/templates/form/field.html': 'templates/form/field.html'
    }
}
0

Ah apparently Magento_Ui/templates is mapped to ui/template in Magento\vendor\magento\module-ui\view\base\requirejs-config.js

So after adding ui/template it works.

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.