Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Understanding the layout engine
 
mhyatt
Jr. Member
 
Total Posts:  1
Joined:  2009-06-11
 

Hello all,

Just getting started with magento.  Can someone please explain to me the following:

The template “2columns-right.phtml” contains the following code: <?php echo $this->getChildHtml('header') ?>
which if my understanind is correct references the page.xml in layout to the following block: 
<block type="page/html_header" name="header" as="header" >
which causes the “header.phtml” file to be displayed.

What is it about this line <block type="page/html_header" name="header" as="header" > which somehow references template/page/html/header.phtml without making use of the template="page/html/* attrinute?

Thanks for all your help.

 
Magento Community Magento Community
Magento Community
Magento Community
 
butterbrot
Member
 
Total Posts:  52
Joined:  2008-10-26
 

hey,

<block type="page/html_header" name="header" as="header" >

type=“page/html_header”
gets resolved to the class ”Mage_Page_Block_Html_Header

which refers to the phtml file

public function _construct()
    
{
        $this
->setTemplate('page/html/header.phtml');
    
}
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top