Magento-在不同的上下文中使用内容块,并且getChildHtml无法正常工作 [英] Magento - using content block in different context and getChildHtml not working

查看:62
本文介绍了Magento-在不同的上下文中使用内容块,并且getChildHtml无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将产品评论栏(通常在其自己的页面上)加载到主产品视图(相关问题

I am loading the product review block, which is normally found on its own page, on to the main product view (related question Magento - display product reviews on product view page).

这正常工作,只是位于review/product/view/list.phtml块中的添加审阅表单(通过$this->getChildHtml('review_form')调用)没有加载到视图中.大概与上下文有关,但是我不确定如何解决此问题.

This is working correctly except that the add review form which is located in the review/product/view/list.phtml block ( called via $this->getChildHtml('review_form') ) isn't loading into the view. Presumably it's to do with the context, but I'm unsure how to fix this.

是否可以通过向我的local.xml文件中添加一些内容来实例化"评论中的此review_form块?

Is it possible to "instantiate" this review_form block within the reviews by adding something to my local.xml file?

为清楚起见,我不想只是将review_form块加载到我的产品视图中,我需要将其加载到reviews块中(在其标记的正确位置).

For clarity, I don't want to just load the review_form block into my product view, I need it to load in the reviews block (in the correct location in its markup).

推荐答案

是可以的.您可以只加载审阅/表单块:<block type="review/form" template="review/form.phtml" />

Yes it is possible. You can just load the review/form block: <block type="review/form" template="review/form.phtml" />

这篇关于Magento-在不同的上下文中使用内容块,并且getChildHtml无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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