Magento: More Flexibility For Your Layout Updates
First thing you are going to want to do is create an event observer to observe the ‘controller_action_layout_generate_xml_before’ event. That event will provide you with the layout object. By accessing the Update object from the layout, we can easily add in our own update:
$layout = $observer->getLayout(); $layout->getUpdate()->addUpdate(' <reference name="content"> <block type="module/block" name="the.name" template="your/template.phtml" /> </reference> ');
If you wanted that block only to be added if the customer is not logged in, you could wrap the code in a conditional. You could get quite creative with this in implementing all sorts of cool functionality as we have done on our project. I hope this provides the tool to get you started!