1

For example:

I have a custom module Vendor_Name in which I want to remove certain blocks but only for all the layouts of the Magento_Customer module so I do not have to create 4 5 layouts to remove the same blocks but I need them somewhere else. I mean, remove top.search block in the customer/login, customer/lougout, customer/forgotpassword layouts and so on but keep them in catalog/view for example, all within a module to easy deploy, just install the module and I have the blocks removed as I want it.

I guess I can put a default.xml in my app/design/frontend/Vendor/Theme/Magento_Customer/layout/default.xml but I do not want to do it in a theme, it is possible to do the same but from a custom module?

1 Answer 1

1

I don't think you should use default.xml in this case. Instead, to perform your task, just modify app/design/frontend/Vendor/Theme/Magento_Customer/layout/customer_account.xml if you want to remove top.search block on any customer pages.

One more case, if you just want to show top.search block on specific page, you can remove it on default.xml. Then add top.search block back on the specific layout file.

And, it's not a good idea to put core layout file into a module.

1
  • Ok i see, i like the idea of ` just modify app/design/frontend/Vendor/Theme/Magento_Customer/layout/customer_account.xml if you want to remove top.search block on any customer pages.` Did not know that creating a customer_account.xml layout it affects all subsequents layout of that module Mar 2, 2018 at 12:19

Your Answer

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

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