将小部件添加到“客户信息"后端页面 [英] Adding a widget to the "Customer Info" backend page

查看:75
本文介绍了将小部件添加到“客户信息"后端页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作一个内部Magento扩展程序,我想在其中添加一些关键指标到客户概览中,即/admin/customer/edit/id/XXX页面:

I am making an internal Magento extension where I would like to add a few key figures to the customer overview, i.e. the /admin/customer/edit/id/XXX page:

如何实现?我尝试过在知识库等中查找内容,但是创建扩展的文档似乎非常有限.

How can that be achieved? I've tried looking in the knowledge base, etc. but the documentation on creating extensions seems to be quite limited.

Magento版本是1.6.x.

The Magento version is 1.6.x.

推荐答案

启动模块的最快方法是使用模块创建者.它添加的文件之一将是 a配置,并在其中添加以下内容...

The fastest way to start a module is with the module creator. One of the files it adds will be a config and to that add the following...

<config>
    <!-- ...existing XML here... -->
    <adminhtml>
        <layout>
            <updates>
                <your_module_name>
                    <file>yourmodule.xml</file>
                </your_module_name>
            </update>
        </layout>
    </adminhtml>
</config>

这将导致文件app/design/adminhtml/default/default/layout/yourmodule.xml被加载,您可以在其中添加一条指令...

That will cause the file app/design/adminhtml/default/default/layout/yourmodule.xml to be loaded, to which you can add a single instruction...

<layout>
    <adminhtml_customer_edit>
        <reference name="customer_edit_tab_view">
            <block type="adminhtml/template" template="your/module/customer/view.phtml" name="your_module_view" />
        </reference>
    </adminhtml_customer_edit>
</layout>

然后 会将(最后一部分,我保证)在现有部分下方的客户编辑页面中添加一个块.它将显示您必须创建并填充HTML的app/design/adminhtml/default/default/template/your/module/customer/view.phtml的内容,也许有点像这样...

And that will add (last part, I promise) a block to the customer edit page below the existing sections. It will show the contents of app/design/adminhtml/default/default/template/your/module/customer/view.phtml which you must create and fill with HTML, perhaps a bit like this...

<!-- Display a nice header around a box -->
<div class="entry-edit">
    <div class="entry-edit-head"><h4><?php echo $this->__('Your Module Info') ?></h4></div>
    <fieldset>
        Your information will show here.
    </fieldset>
    </div>
</div>

这种方法很安全,因为所有文件路径都将在其中包含模块名称,所以任何升级都不会覆盖您添加的内容.

This way is safe, no upgrades can overwrite your additions because all the file paths will have your module name somewhere in them.

这篇关于将小部件添加到“客户信息"后端页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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