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'
 }
}
asked Apr 23, 2018 at 8:53

1 Answer 1

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.

Rama Chandran M
3,26515 gold badges24 silver badges38 bronze badges
answered Apr 25, 2018 at 10:04

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.