如何在magento的phtml文件中调用cms页面? [英] How to call a cms page in a phtml file in magento?

查看:46
本文介绍了如何在magento的phtml文件中调用cms页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在自定义模块的phtml文件中显示CMS页面.有什么办法可以通过xml布局或直接在phtml文件中进行编码来包含它?我知道我们可以添加cms块,但是如何添加cms页面?

I need to display a CMS page inside my custom module's phtml file. Is there any way I can include it either through xml layout or via coding directly in phtml file? I know we can add a cms block but how can we add a cms page?

推荐答案

在您的phtml文件中尝试以下代码

Try the below code in your phtml file

 $page = Mage::getModel('cms/page')->load('home_page','identifier');
 echo $page->getContent();

这篇关于如何在magento的phtml文件中调用cms页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆