首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >添加一个小部件到“客户信息”后台页面

添加一个小部件到“客户信息”后台页面
EN

Stack Overflow用户
提问于 2011-12-11 17:36:06
回答 1查看 154关注 0票数 0

我正在制作一个内部Magento扩展,我想在客户概述中添加几个关键数字,即/admin/customer/edit/id/XXX页面:

如何才能做到这一点?我试着在知识库中查找,等等,但是关于创建扩展的文档似乎相当有限。

Magento版本为1.6.x。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-12-11 20:43:47

启动模块的最快方法是使用the module creator。它添加的其中一个文件将是a config,并为此添加以下内容...

代码语言:javascript
复制
<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,您可以向该文件中添加一条指令...

代码语言:javascript
复制
<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>

这将添加(最后一部分,我保证)到客户编辑页面下面的现有部分的块。它将显示您必须创建并填充的app/design/adminhtml/default/default/template/your/module/customer/view.phtml的内容,可能有点像这样……

代码语言:javascript
复制
<!-- 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>

这种方式是安全的,没有升级可以覆盖你的添加,因为所有的文件路径都会在它们的某个地方包含你的模块名称。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/8463041

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档