2015-07-13 120 views
1

我在catalog/product/new.phtml中創建了一個new.phtml頁面。 其中包含new/latest products。 我有另一個.phtml頁[product_slider.phtml]。我想添加new.phtmlproduct_slider.phtml 是這種可能性。如何使用..任何想法。?在另一個.phtml頁面中顯示.phtml頁面

回答

0

回答

嘗試我得到了解決方案的代碼之後。

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

你必須確保塊類型,而不是core/template

4

要在其他一個.phtml頁面顯示一個.phtml頁。您可以使用:

<?php echo $this->getLayout()->createBlock('core/template')->setTemplate('path after template dir/filename.phtml')->toHtml(); ?> 
相關問題