我在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内容不显示在产品页面view.phtml
- 2. Magento缓存自定义phtml页面
- 3. Magento在另一个phtml文件中包含phtml文件
- 4. 显示使用PHTML
- 5. 如何在magento中的phtml文件中调用cms页面?
- 6. 如何调用cms页面中的phtml文件来设置页面标题
- 7. 如何在CMS页面中调用PHTML文件Magento
- 8. 如何在magento的specfic页面中调用.phtml块?
- 9. 自定义php脚本的Magento会话不显示在phtml页面 - ajax
- 10. 显示另一个HTML页面中的iframe的父HTML页面
- 11. 在另一个页面显示sharepoint页面
- 12. 从一个页面抓取信息并在另一个页面中显示
- 13. 从一个页面获取the_content并在另一个页面中显示(Wordpress)
- 14. magento:如何将模板中的phtml块添加到CMS页面
- 15. .phtml页面中的Magento更改未反映
- 16. 显示从另一个PHP页面,而页面重载
- 17. 从另一个ASPX页面显示DIV?
- 18. 在phtml中显示静态块
- 19. 如何在MVC的另一个页面中显示html页面的一部分
- 20. 在另一个HTML页面中显示HTML页面的一部分
- 21. ModX:使用GetResources在一个页面中显示多个页面
- 22. 将自定义PHTML模板添加到Magento CMS页面
- 23. Magento:重定向到控制器的phtml页面?
- 24. 下载/打开“PHTML”而不是打开的页面,apache2的
- 25. 添加自定义的phtml /块到群集页面magento
- 26. 后台管理页面phtml文件的文件位置
- 27. 如何在我的页面中显示来自另一个页面的图像
- 28. 显示一个HTML页面
- 29. Magento 2 - 如何在另一个phtml文件,xml布局,静态块和cms页面中调用自定义phtml文件?
- 30. 如何取消显示一个页面,并在JQuery Mobile中显示另一个页面?