从Magento中的local.xml添加块

时间:2012-02-23 10:48:57

标签: magento

我需要在页面上添加自定义块。在哪里真的不重要。对于此示例,我希望它在 customer / account /

因此,查看 customer.xml ,我看到了这条路径:

   <customer_account_index translate="label">
       [code]
       <reference name="my.account.wrapper">
           [code]
       </reference name="my.account.wrapper">
   </customer_account_index>

以下示例是 local.xml

中的代码
    <customer_account_index>
    <reference name="my.account.wrapper">
        <block type="core/template" 
           name="customer_groupsprogressbar"          
           template="customer/groupsprogressbar.phtml" />
    </reference>
    </customer_account_index>

出了点问题,因为它没有出现。如果我在 customer.xml 中添加该块,则所有工作正常。

我在这里做错了什么线索?

1 个答案:

答案 0 :(得分:3)

尝试

<customer_account_index>
    <reference name="my.account.wrapper">
        <block 
            type="core/text_list" 
            name="customer_groupsprogressbar"          
            template="customer/groupsprogressbar.phtml" />
    </reference>
</customer_account_index>

<customer_account_index>
    <reference name="my.account.wrapper">
        <block 
            type="core/template" 
            name="customer_groupsprogressbar"          
            template="customer/groupsprogressbar.phtml" output="toHtml" />
    </reference>
</customer_account_index>

OR 在my.account.wrapper模板中:

<?php echo $this->getChildHtml('customer_groupsprogressbar'); ?>
相关问题