我在catalog/product/new.phtml
中創建了一個new.phtml
頁面。 其中包含new/latest products
。 我有另一個.phtml
頁[product_slider.phtml
]。我想添加new.phtml
到product_slider.phtml
是這種可能性。如何使用..任何想法。?在另一個.phtml頁面中顯示.phtml頁面
1
A
回答
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(); ?>
相關問題
- 1. Magento在另一個phtml文件中包含phtml文件
- 2. 如何在magento的specfic頁面中調用.phtml塊?
- 3. 如何在CMS頁面中調用PHTML文件Magento
- 4. 在另一個頁面顯示sharepoint頁面
- 5. 從一個頁面抓取信息並在另一個頁面中顯示
- 6. 從一個頁面獲取the_content並在另一個頁面中顯示(Wordpress)
- 7. 顯示從另一個PHP頁面,而頁面重載
- 8. 在另一個HTML頁面中顯示HTML頁面的一部分
- 9. 如何在MVC的另一個頁面中顯示html頁面的一部分
- 10. Magento:重定向到控制器的phtml頁面?
- 11. 下載/打開「PHTML」而不是打開的頁面,apache2的
- 12. 後臺管理頁面phtml文件的文件位置
- 13. 添加自定義的phtml /塊到羣集頁面magento
- 14. Magento:如何判斷您是在類別頁面還是在.phtml文件中的產品頁面
- 15. 如何使用PHP來顯示一個HTML頁面或另一個頁面?
- 16. 使用iframe將div從一個頁面顯示到另一個頁面
- 17. wordpress:如何在一個頁面上顯示多個頁面?
- 18. 在xcode中從一個頁面導航到另一個頁面
- 19. 在Silverlight中從一個頁面過渡到另一個頁面
- 20. PHP,兩頁,從一個頁面的選項顯示在另一個頁面中的三種形式之一
- 21. AngularJS分頁只顯示一個頁面
- 22. 如何創建兩個頁面,以便一個頁面顯示輸入到另一個頁面的內容?
- 23. 如何在另一個頁面中回顯一頁內容?
- 24. 在另一個頁面上顯示一個jQuery變量
- 25. JSF通過一個列表顯示在另一個頁面
- 26. 顯示一個空白頁面而不是JSP頁面中的異常頁面
- 27. 僅在一個頁面上顯示主頁面標題
- 28. 在頁面內顯示.Net頁面
- 29. 索引搜索在另一個頁面中顯示結果
- 30. 只在主頁面顯示一個div