如何在cms/content_home.phtml上调用newsletter/subscribe.phtml? [英] how to call newsletter/subscribe.phtml on cms/content_home.phtml?

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

问题描述

我想在内容区域的主页上创建一个新闻通讯订阅框,为此,我创建了一个CMS页面,我放置在新闻通讯订阅文件中的其他代码也可以调用.

I want to make a newsletter subscription box on home page in content area, and for that I have made a CMS page that other code I have placed in the newsletter subscription file can call too.

我正试图这样称呼它:

<?php echo $this->getLayout()->createBlock('newsletter/subscribe')->setTemplate('newsletter/subscribe.phtml')->toHtml(); ?>

,但未显示.

为什么?

推荐答案

system -> configuration -> advanced

从那里启用新闻通讯模块.然后您可以使用上面的代码在任何地方调用它.

from there enable newsletter module. and then you can use the above code to call it anywhere.

<?php echo $this->getLayout()->createBlock('newsletter/subscribe')->setTemplate('newsletter/subscribe.phtml')->toHtml(); ?>

这篇关于如何在cms/content_home.phtml上调用newsletter/subscribe.phtml?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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