Search code examples
magentomagento-1.7magento-1.9magento-1.8magento-1.4

Get a block type of a page Magento


I would like to know how to find the block type of some page example : the home page.

I have a problem in my homepage, I want to display some block, in the xml I declared my block in <cms_index_index> (local.xml) but if I put it in the <reference name="head"> it appears, if <reference name="content"> or <reference name="content"> it does not work . It seems to me that the type of block is not good.

xml:

<cms_index_index>
        <reference name="root">
            <block type="core/template" name="seconnecter_test" template="customer/form/test-seconnecter.phtml"/>
        </reference>
</cms_index_index>

in the homepage 1column-full.phtml i called it like this:

<?php echo $this->getChildHtml('seconnecter_test');?>

Solution

  • You can use

    <reference name="root">
        <block type="core/template" name="seconnecter_test" output="toHtml" template="customer/form/test-seconnecter.phtml"/>
    </reference>