Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

want to call one phtml file in another phtml file using anchor tag

I'm using Magento.

I want display and call one phtml file as a link in another phtml file…

I have the new.phtml file on the home page. On that I put one link CHECK ALL which display all new products as category page.. It looks like category page. For that I create another phtml file named newproductpage.phtml which has same code of new.phtml. Now I try to call this newproductpage.phtml file @homepage as CHECK ALL link for that I write this code....

<a href="<?php echo $this->getUr('newproductpage.phtml')?>">CHECK ALL</a>

But its not working....

thnx..

like image 489
Bhavik Shah Avatar asked Dec 05 '22 10:12

Bhavik Shah


1 Answers

you call newproductpage.phtml in any phtml file using below code

<?php echo $this->getLayout()->createBlock('core/template')->setTemplate('custom/newproductpage.phtml')->toHtml(); ?>
like image 160
Deepak Mallah Avatar answered Dec 09 '22 15:12

Deepak Mallah