Magento 使用phtml代码而不是xml代码来显示评论

Magento 使用phtml代码而不是xml代码来显示评论,magento,Magento,我在catalog.xml文件中添加了下面的代码,现在查看部分显示在产品视图页面中。但我只想在特定选项卡下显示它 <block type="review/product_view_list" name="product.info.product_additional_data" as="product_review" template="review/product/view/list.phtml"> <block type="review/form" name="produc

我在catalog.xml文件中添加了下面的代码,现在查看部分显示在产品视图页面中。但我只想在特定选项卡下显示它

<block type="review/product_view_list" name="product.info.product_additional_data" as="product_review" template="review/product/view/list.phtml">
<block type="review/form" name="product.review.form" as="review_form"/></block>

是否有任何方法可以使用phtml代码来显示此审阅部分


因此,我计划使用该选项卡下的phtml代码,您可以调用特定的选项卡内容
getChildHtml
函数来调用特定的块内容。如下图所示:

echo $this->getChildHtml('product_review');

echo $this->getChildHtml('review_form');


要在哪个选项卡中显示它?您是否在view.phtml上显示了所有选项卡代码?@PankajPareek请检查
Review
tab下我想显示该评论section@PankajPareek我在查看页面中显示了4个选项卡,在一个特定选项卡下,我想显示评论部分。我不知道为什么它对我不起作用。可能是我做错了什么。谢谢你的支持。我找到了解决方案。如果你点击
addreview
选项卡,你会看到两个部分,一个是已经发布的评论。另一个部分是
写你自己的评论
我想在另一个选项卡中显示
写你自己的评论
部分。我也找到了该部分的解决方案,我还有一个问题,我将发布新问题并尽快通知你。
<?php
$reviewListBlock = $this->getLayout()->createBlock('review/product_view_list');
$reviewFormBlock = $this->getLayout()->createBlock('review/form');

echo $reviewListBlock->setTemplate('review/product/view/list.phtml')->toHtml();
echo $reviewFormBlock->setTemplate('review/form.phtml')->toHtml();
?>