通过模块xml文件Magento向产品视图页面添加一些块 [英] Add some block to product view page through module xml file Magento

查看:62
本文介绍了通过模块xml文件Magento向产品视图页面添加一些块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个简单的扩展程序,其中

Hi i am developing a simple extension in which

我需要通过xml文件在产品页面上插入一个新块.下面是我模块的xml文件

i need to insert a new block on product page through xml file. Below is the xml file of my module

<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 动作,并且 total.phtml 文件的内容可见.我需要在产品页面上插入total.phtml的内容.

In this, layout is working on module index action and the content of total.phtml file is visible. I need to insert the content of total.phtml on product page.

所以请建议我如何通过xml在产品页面上插入

So please suggest me how can i inset this on product page through xml.

谢谢

推荐答案

尝试一下:

<catalog_product_view>
        <reference name="alert.urls"> 
            <block type="total/prototal"  name="total_prototal" template="total.phtml" />  
        </reference>
</catalog_product_view>

确保该行必须存在于view.phtml文件中:

make sure this line must be exist in view.phtml file:

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

希望这会有所帮助!

这篇关于通过模块xml文件Magento向产品视图页面添加一些块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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