内容管理器 API
🌐 Content Manager APIs
Page summary:内容管理器 API 通过
addEditViewSidePanel、addDocumentAction、addDocumentHeaderAction、addBulkAction或addRichTextBlocks向内容管理器添加面板、操作和自定义富文本块。每个 API 都接受带有类型化上下文的组件函数,从而实现对文档感知 UI 注入的精确控制。
内容管理器 API 是 管理面板 API 的一部分。它们是 Strapi 插件向 内容管理器 添加内容或选项的一种方式。内容管理器 API 允许你通过添加来自你自己插件的功能来扩展内容管理器,就像你可以通过 注入区域 所做的一样。
🌐 Content Manager APIs are part of the Admin Panel API. They are a way for Strapi plugins to add content or options to the Content Manager. The Content Manager APIs allow you to extend the Content Manager by adding functionality from your own plugin, just like you can do it with Injection zones.
在深入了解本页的概念之前,请确保你已经:
🌐 Before diving deeper into the concepts on this page, please ensure you have:
- 创建了一个 Strapi 插件,
- 已阅读并理解了 管理面板 API 的基础知识
一般信息
🌐 General information
Strapi 5 提供了 4 个内容管理器 API,所有 API 都可以通过 app.getPlugin('content-manager').apis 访问。所有内容管理器 API 具有相同的 API 结构,并且必须使用组件。
🌐 Strapi 5 provides 4 Content Manager APIs, all accessible through app.getPlugin('content-manager').apis.
All the Content Manager APIs share the same API shape and must use components.
注入区与内容管理器 API
🌐 Injection zones vs. Content Manager APIs
要向内容管理器添加面板、操作或按钮,内容管理器 API(addDocumentAction、addEditViewSidePanel 等)通常比注入区更稳健且类型更明确。当需要将组件插入内容管理器 API 未覆盖的特定 UI 区域时,请使用注入区。
🌐 For adding panels, actions, or buttons to the Content Manager, the Content Manager APIs (addDocumentAction, addEditViewSidePanel, etc.) are often more robust and better typed than injection zones. Use injection zones when you need to insert components into specific UI areas not covered by the Content Manager APIs.
内容管理器 API 和注入区都是用于自定义管理面板的扩展点,但它们解决的是不同的需求: