3
我很难将产品评论放置在特定位置的主要产品视图中。我可以将它们加载到内容区域,但不是在我需要的特定位置(在某些视图标记内)。Magento - 在产品视图页面上显示产品评论
我有在它下面的一个local.xml中:
<catalog_product_view>
<reference name="content">
<block type="review/product_view_list" name="product.info.product_additional_data" as="reviews" template="review/product/view/list.phtml"/>
</reference>
<catalog_product_view>
上述载荷所有其他内容后的评价 - 可以预料,由于不是一个模板块内容。
我试图定义块中的内容的参考的外部,并且在相关点放置此:
<?php echo $this->getChildHtml('reviews') ?>
为了清楚起见,这里是我所需要的块出现在view.phtml:
<div class="product-collateral">
<?php foreach ($this->getChildGroup('detailed_info', 'getChildHtml') as $alias => $html):?>
<div class="box-collateral <?php echo "box-{$alias}"?>">
<?php if ($title = $this->getChildData($alias, 'title')):?>
<h2><?php echo $this->escapeHtml($title); ?></h2>
<?php endif;?>
<?php echo $html; ?>
</div>
<?php endforeach;?>
<?php echo $this->getChildHtml('upsell_products') ?>
<?php echo $this->getChildHtml('product_additional_data') ?>
<?php echo $this->getChildHtml('reviews') ?>
</div>
不幸的是,这根本不输出任何东西。我对Magento相当陌生,如何实现上述目标,我感到茫然。
谢谢,但我不能让你的方法在我的环境中工作。基本上,我想在view.phtml标记中添加'
'内的块 - 我尝试过''product_info_additional“之后',但它不起作用。我用更多的信息修改了我的问题。 – BrynJ好吧,我已经研究了一下这个问题。接受了layout/tag.xml中的例子。基本上你会想把参考名称从“内容”改为“product.info.additional”。这将包括在特定div中的块。之后,应该很容易用前后属性来调整位置。 –
这是行得通的,谢谢!我现在有另一个相关的问题,也许你可以看看 - [http://stackoverflow.com/questions/19277522/magento-using-content-block-in-different-context-and-getchildhtml-not-working] – BrynJ