You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何修改Strapi v4.10.5插件名称并移至Content manager上方?

Strapi v4.10.5 修改插件名称并调整排序至Content Manager上方的解决方案

修改插件名称

针对自定义插件

直接修改插件根目录下的package.json文件,找到strapi.displayName字段,替换为你需要的名称:

{
  "name": "my-custom-plugin",
  "strapi": {
    "displayName": "自定义插件名称",
    // 其他配置项
  }
}

针对官方插件(避免修改源码)

在项目根目录的src/admin/app.js文件中,通过重新注册插件的方式覆盖原有名称:

// 以用户权限插件为例
import pluginPkg from '../node_modules/@strapi/plugin-users-permissions/package.json';
import pluginIcon from '@strapi/icons/User';

strapi.registerPlugin({
  ...pluginPkg,
  displayName: '自定义用户权限管理', // 替换为你的目标名称
  icon: pluginIcon,
});

调整插件至Content Manager上方

Strapi v4通过菜单权重控制插件排序,Content Manager默认权重为1,将目标插件的权重设为0即可排在其上方。

针对自定义插件

在插件根目录的strapi-server.js中添加admin菜单配置:

module.exports = {
  register({ strapi }) {
    // 插件注册逻辑
  },
  bootstrap({ strapi }) {
    // 插件启动逻辑
  },
  config: {
    admin: {
      menu: {
        position: 0, // 权重值小于1即可排在Content Manager之前
      },
    },
  },
};

针对官方插件

同样在src/admin/app.js中重新注册插件时指定菜单权重:

import contentManagerPkg from '../node_modules/@strapi/plugin-content-manager/package.json';
import contentManagerIcon from '@strapi/icons/ContentManager';
// 引入你要调整的插件信息
import targetPluginPkg from '../node_modules/your-target-plugin/package.json';
import targetPluginIcon from '@strapi/icons/TargetIcon';

// 明确Content Manager的权重(可选,默认就是1)
strapi.registerPlugin({
  ...contentManagerPkg,
  icon: contentManagerIcon,
  menu: {
    position: 1,
  },
});

// 注册目标插件并设置更低的权重
strapi.registerPlugin({
  ...targetPluginPkg,
  displayName: '你的插件名称', // 若需同时改名称可在此配置
  icon: targetPluginIcon,
  menu: {
    position: 0,
  },
});

生效注意事项

  • 修改完成后,重启Strapi服务
  • 清空浏览器缓存(或使用无痕模式打开admin面板),避免缓存导致配置不生效

内容的提问来源于stack exchange,提问作者n1koloza

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.19 05:00:12