Get all blocks from a certain handle or routes
I am looking for a way to get all blocks belonging to a certain handle or route, for example get all blocks within catalog_product_view
. Is this possible without looping through all XML files?
The main goal is getting the block name by the template attribute, since this is displayed by the profiler. But so far I am unable to figure this out.
Clarification
I want to hide certain blocks ( in the frontend) from a menu in the Magento backend. Since blocks may differ from theme to theme I decided to just make a field where users put in the block name. Then observe if this configuration field is set and if it is remove this block before it's get rendered.
This works great, but most users do not know where to find the block name, so they are unable to do this. So I was thinking how to simplify this process and thought they could turn on their profiler so they could look up the block they needed to remove. Unfortunately the profiler does not give the block name and shows only an alias and the template file.
Since not every block has an alias but every ( displayed ) block has an template file i decided instead of a block name they could just enter the template file path given by the profiler for the specific block and observe the save event of the config page and automaticly find the corresponding block name. This however seems to be a challenge.