将块添加到product_type_data

时间:2015-11-10 10:54:19

标签: magento layout

HY, 我正在编写一个自定义模块,我想将自定义块添加到app / design / frontend / mytemplate / default / template / catalog / product / view / type / default.phtml

我不能使用额外的数据占位符,所以我要修改default.phtm,我添加了这段代码:

        <?php echo $this->getChildHtml('msgdisp') ?>        

在我的模块layout.xml中我写了以下部分:

<?xml version="1.0"?> <layout version="1.0.0">
<catalog_product_view>
    <reference name="??????">
        <block type="core/template" name="msgdisp" as="msgdisp" template="msgdisp/messaggiodisp.phtml"/>
    </reference>
</catalog_product_view>

我不知道我要放的是什么而不是??????,到目前为止我已经尝试过:

product_type_data

product.info.simple

但上述任何人都没有工作。

在messaggiodisp.phtml中,我写了一个简单的“占位符”代码

<!-- Hello World -->

请让我知道我做错了什么..

1 个答案:

答案 0 :(得分:0)

好的,我找到了一个解决方案,我在xml文件中错了:

<PRODUCT_TYPE_simple>
<reference name="product.info.simple">
    <block type="core/template" name="msgdisp" as="msgdisp" template="msgdisp/messaggiodisp.phtml"/>
</reference>

相关问题