Show .phtml page on another .phtml page

I created the new.phtml page in catalog/product/new.phtml . which contain new/latest products . I have another .phtml [ product_slider.phtml ] page. I want to add new.phtml to product_slider.phtml is this possible. ?? how to use .. any idea.?

+1
source share
3 answers

Answer

After trying the code, I got a solution.

 <?php echo $this->getLayout()->createBlock('core/template')->setTemplate('catalog/product/new.phtml')->toHtml(); ?> 
0
source

Display the .phtml page on another .phtml page. you can use:

 <?php echo $this->getLayout()->createBlock('core/template')->setTemplate('path after template dir/filename.phtml')->toHtml(); ?> 
+4
source
 <?php echo $this->getLayout()->createBlock('core/template')->setTemplate('custom/product_slider.phtml')->toHtml(); ?> 

You need to make sure the type of block, not core/template

+3
source

Source: https://habr.com/ru/post/906306/


All Articles