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.?
new.phtml
catalog/product/new.phtml
new/latest products
.phtml
product_slider.phtml
Answer
After trying the code, I got a solution.
<?php echo $this->getLayout()->createBlock('core/template')->setTemplate('catalog/product/new.phtml')->toHtml(); ?>
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(); ?>
<?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
core/template
Source: https://habr.com/ru/post/906306/More articles:java.text.ParseException: Unsurpassed date: "Thu January 19, 2012 20:00" - javayou want to call one phtml file in another phtml file using the anchor tag - phpdisplay vertical lines and horizontal lines in sections - chartsExtrapolation - awk - linuxT-Sql Query xml - xmlHow to add T to the list , where List masquerades as "dynamic" and T as "object"? - collectionsHow to request a password on a Windows console in a Perl script? - windowsMySQL is not a valid win32 application - mysqlMagento calls a cms page via an anchor tag from a phtml file - phpWebResource.axd - asp.netAll Articles