重新排序 magento admin 系统/配置左侧导航

发布于 2024-11-16 16:42:57 字数 110 浏览 2 评论 0原文

一个简单的问题。 在 magento 中,当进入系统/配置时,左侧导航中有一些主要选项卡。 常规、目录、客户、销售、高级等。

我想知道什么 xml 为这些设置了顺序?我希望高级版位于最上面。

a simple question.
In magento, when going to System / Configuration there are some main tabs in left navigation.
General, Catalog, Customer, Sales, Advanced, etc.

I wonder what xml set the order for those? I would love to have Advanced somewhere on top.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

柒七 2024-11-23 16:42:57

查看 Mage/Core/etc/system.xml 文件,我在顶部附近看到了这一点:

<config>
    <tabs>
        <general translate="label" module="core">
            <label>General</label>
            <sort_order>100</sort_order>
        </general>
        <service translate="label" module="core">
            <label>Services</label>
            <sort_order>99999</sort_order>
        </service>
        <advanced translate="label" module="core">
            <label>Advanced</label>
            <sort_order>999999</sort_order>
        </advanced>
    </tabs> 
    ...
</config>

我猜测(但尚未验证)更改此文件中的 sort_order 参数将为您更改该顺序。

希望有帮助!

谢谢,

Looking at the Mage/Core/etc/system.xml file, I see this near the top:

<config>
    <tabs>
        <general translate="label" module="core">
            <label>General</label>
            <sort_order>100</sort_order>
        </general>
        <service translate="label" module="core">
            <label>Services</label>
            <sort_order>99999</sort_order>
        </service>
        <advanced translate="label" module="core">
            <label>Advanced</label>
            <sort_order>999999</sort_order>
        </advanced>
    </tabs> 
    ...
</config>

I'm guessing (but haven't verified) that changing the sort_order parameter in this file will change that order for you.

Hope that helps!

Thanks,
Joe

我的痛♀有谁懂 2024-11-23 16:42:57

所以我发现,当安装一些 Magento 扩展时,它们将有 etc/system.xml 文件,其中包含该行
100
这将与 Mage/Core/etc/system.xml 中的同一行竞争,因此与全新安装顺序相比,系统下的配置菜单将出现混乱。

问题在于查找和编辑所有这些 XML 文件。它们的结构都类似于 /etc/system.xml,但是如果错误的文件被破坏(去过那里,做过那件事),那么很容易弄错错误的文件并失去跟踪。我做了什么针对所有这些文件的共同点设置了文本搜索,这些共同点在其他 /etc/system.xml 文件中不会相似。这将是 XML 文件的 部分。然而,使用标题标题可能会导致更多混乱,因此我选择了第一个或第二个子菜单名称。例如,我的扩展之一是 TBT Corp 扩展的“增强型产品网格”,因此它为我提供了搜索 。重点是我使用了扩展程序特有的文本,与其他标签不一样。

这给了我在 /app/code/community/TBT/Enhancedgrid/etc 中找到的正确的 /etc/system.xml

<tabs>
    <tbtall translate="label" module="enhancedgrid">
        <label>TBT Corp Extensions</label>
        <sort_order>100</sort_order>
    </tbtall>
</tabs>

正如您所看到的,排序顺序为 100 时,它最终会位于排序顺序的顶部附近,因此将其更改为 300 或更大(301、400、401)可将事物重新按顺序排列。在我的整个网站上系统地执行此操作给了我我想要的东西。我有很多这样的事情要做,所以也许我的下一步将是第二次搜索并执行命令行来创建一个不可变文件chattr +i filename以添加不可变(减号以撤消不可变),所以某些更新会让它们保持原样或给出安装错误?

最后,一些扩展在其标题下有多个标签,因此必须找到一些扩展并将其排序为扩展组标题。另外,我还必须返回 /app/code/core/Mage/ModuleName ,因为“常规从‘100’开始,“目录”从‘200’开始,并且“客户”从300开始等等,我将它们分别更改为“100”,“102”,“103”,将它们放在第一位。所以/app/code/core/Mage/Sales/etc/system.xml我把它放在“104”,所以它更接近安装时的原始顺序,非常重要的是保存备份。在你的文件夹中,但要像 system.xml.backup 而不是像 backup.system.xml 那样,否则 Magento 将加载以“.xml”结尾的任何内容

我的希望是这样不仅有帮助,而且还是一个简短的指南!

So What I have found is when some Magento extensions are installed they will have etc/system.xml file with the line in it
<sort_order>100</sort_order>.
This will compete with the same line in Mage/Core/etc/system.xml, so the configuration menu under system will be out of order compared to the fresh install order.

The problem is locating and editing all of these XML files. They will all be structured like /etc/system.xml, but it is too easy to mistake the wrong file and loose track if the wrong file gets mangled (been there, done that).What I did was set up a text search for on specific thing all these files have in common that would not be similar in other /etc/system.xml files. This would be the <label>General</label> portion of the XML file. However using the header title may lead to more confusion so I picked the first or second sub menu name. For example on of my extensions is TBT Corp Extension's "Enhanced Product Grid", so the gave me the search <label>Enhanced Product Grid</label>. The point being I used text that unique to the extension and not in common with other labels.

This gave me the right /etc/system.xml in /app/code/community/TBT/Enhancedgrid/etc where I found this;

<tabs>
    <tbtall translate="label" module="enhancedgrid">
        <label>TBT Corp Extensions</label>
        <sort_order>100</sort_order>
    </tbtall>
</tabs>

As you can see with the sort order of 100 it will end up near the top of the sort order, so changing it to 300 or greater (301, 400, 401) put things back in order. Doing this systematically throughout my site gave me what I want. I had many of these to do, so perhaps my next step would be a second search and do a command line to make an immutable file chattr +i filename to add immutable (a minus to undo immutable), so some update will leave them as is or give an install error?

In final some of the extensions had multiple labels under their Title so some had to be found and sorted be the extensions group Title. Also I had to go back to /app/code/core/Mage/ModuleName and since "General started at '100' and "Catalog" started at '200' and "Customers" started at 300' and so forth, I change them respectively to '100', '102', '103' down the line to put them first. So/app/code/core/Mage/Sales/etc/system.xml I put is at '104' so it was closer to the original order upon install. Very IMPORTANT would to save a backup right in you folders, but do it like system.xml.backup and not like backup.system.xml otherwise Magento will load anything ending in ".xml"

My hope is this not only helps but somewhat of a short guide!

纸伞微斜 2024-11-23 16:42:57

您需要通过在属性集管理器(在管理的产品菜单中)中上下拖动文件夹来基于每个属性集进行设置。

在此处输入图像描述

You need to set these on a per attribute-set basis by dragging the folders up and down in the attribute-set-manager (in products menu of admin).

enter image description here

栀梦 2024-11-23 16:42:57

在产品编辑页面上编辑选项卡有两种方法,前几个选项卡由属性组顺序管理(正如 Mathew 指出的)。第二组选项卡是通过在块中添加选项卡直接添加到代码中的。

因此有两种方法可以修改这些选项卡。

  1. 更改属性集中属性组的顺序(使用 GUI)
  2. 扩展选项卡块 Core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tabs.php,并手动更改选项卡的顺序。

在该块中,您还可以使用 $this->addTab() 添加自己的自定义选项卡

There are two ways of editing the tabs on the product edit page, the first few tabs are managed by the attribute group order (as Mathew pointed out). The second bunch of tabs are added directly in the code via adding a tab in the block.

So there are two ways of modifying those tabs.

  1. Change the order of the attribute groups within the attribute set (using the GUI)
  2. Extend the Tab block, Core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tabs.php, and manually change the order of the tabs.

Within the block you can add your own custom tabs as well using $this->addTab()

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文