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

asked Jul 23, 2016 at 7:00

1 Answer 1

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();
answered Jul 23, 2016 at 10:43

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.