Magento 1 – When to Use ‘name’ and When to Use ‘as’

blockslayoutmagento-1theme

I've found that when trying to use the unsetChild method, sometimes I have to use the 'name' attribute and others 'as'. It seems that if a block is added normally, you use 'as' but if it is added to a block using the append method, you may have to use 'name'. Is this assumption correct?

What is the reasoning behind this and is there a standard way to understand which attribute you should use?

Best Answer

Block can always be referenced by name. Alias (as) is used to simplify the long name of a block and the only differs with the scope. Name has to be unique within the page and alias within a parent block.

Related Topic