您好,我正在开发一个简单的扩展,其中
我需要通过 xml 文件在产品页面上插入一个新块。下面是我的模块的xml文件
<layout version="0.1.0">
<total_index_index>
<reference name="root">
<action method="setTemplate"><template>page/2columns right.phtml</template></action>
</reference>
<reference name="content">
<block type="total/prototal" name="total_prototal" template="total.phtml" />
</reference>
</total_index_index>
</layout>
在此,布局正在模块上工作index行动和内容总计.phtml文件可见。我需要在产品页面上插入total.phtml的内容。
所以请建议我如何通过 xml 将其插入到产品页面上。
Thanks
尝试这个:
<catalog_product_view>
<reference name="alert.urls">
<block type="total/prototal" name="total_prototal" template="total.phtml" />
</reference>
</catalog_product_view>
确保 view.phtml 文件中必须存在此行:
<?php echo $this->getChildHtml('alert_urls') ?>
希望这可以帮助!
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)