What Block Am I In?

Trying to remove a block from a layout and it won’t go away? A trick to figure out where you are working is to use $block->getNameInLayout() and that should tell you what block you need to remove.

Did you create a module, does it load after or before a core module that might be putting your block back in? Did you set the core module as a dependency in both composer.json and module.xml in your module? If not, add that in, and setup:upgrade module:disable your module and setup:upgrade module:enable your module to force the dependency order to get reset.

Leave a Reply

Your email address will not be published. Required fields are marked *