I am currently working on a Magento extension, and I have overridden a core controller, which works fine.
I have now added a new action to my controller. Problem is that whenever I call the action a blank page is produced. If I echo something it is displayed correctly.
Therefore I dug into the core of the Customer module and controllers. I saw there that methods like indexAction()
implement the layout this way:
<?php
public function indexAction()
{
$this->loadLayout();
$this->_initLayoutMessages('customer/session');
$this->_initLayoutMessages('catalog/session');
$this->getLayout()->getBlock('content')->append(
$this->getLayout()->createBlock('customer/account_dashboard')
);
$this->getLayout()->getBlock('head')->setTitle($this->__('My Account'));
$this->renderLayout();
}
I transferred this to my own action and the layout is now rendered correctly. Now for the question:
No matter what I enter into the ->createBlock('...')
call, nothing is rendered into the content area.
How do I specify the location of my own block to be rendered as the content of the page while still decorating it with the layout?
I tried fiddling with the xml files in /design/frontend/base/default/layout/myaddon.xml but couldn't really make it work.