Magento – How to find out which layout handles to be changed

layoutmagento-1.9

How do I find out which handles should I use when I want to customize a certain page?

For example, by searching online, I found out that checkout_onepage_index is the handle to modify the Checkout page. I don't know about this magic, but somehow somebody just know it and I want to know how the learn this magic.

<?xml version="1.0"?>
<layout>
    <checkout_onepage_index>
        <reference name="head"></reference>
    </checkout_onepage_index>
</layout>

How do I know what handles if let say I want to modify the success page instead? or the frontend order detail page? etc…?

Best Answer

You can add this to your controller action. It will show handles in more neat way than var_dump. Strange that this answer is not already on stack.

Zend_Debug::dump($this->getLayout()->getUpdate()->getHandles());