2

I want to call another module block in custom phtml file in magento

Here is layout file tablisting.xml:
path: app\design\frontend\default\default\layout\sm\tablisting.xml

<?xml version="1.0"?>   
<layout version="1.0">
<default>
    <reference name="head">
        <action method="addCss"><stylesheet>sm/tablisting/css/tablisting.css</stylesheet></action>
    </reference>
</default>
<tablisting_index_index>
    <reference name="content">
        <block type="tablisting/list" name="tablisting">
            <action method="setConfig">
            </action>
        </block>
    </reference>
</tablisting_index_index>   

I have create a template file homecolumn.phtml

Here is template file homecolumn.phtml:
app\design\frontend\default\sm_saphi\template\page\homecolumn.phtml

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

But it is not show any block in homepage

2

Finally I have find my answer.

Please add this code in template file homecolumn.phtml: path:app\design\frontend\default\sm_saphi\template\page\homecolumn.phtml

<?php
 echo  Mage::app()->getLayout()
    ->createBlock('tablisting/list')
    ->setTemplate('page/homecolumn.phtml')
    ->toHtml();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.