如何通过代码(可见/可编辑/布局)配置Strapi内容类型“元数据”

时间:2020-08-17 10:11:58

标签: strapi

我想知道是否可以通过代码而不是通过Strapi Web UI配置字段edtiable状态(以及其他关联的视图布局信息)?

例如在Strapi中,您可以自定义视图,并将这些设置写入core_store数据库表中,并键入键为plugin_content_manager_configuration_content_types::application::video.video

的json对象中。

通过Web UI进行更改时,文件系统上的代码未更改。一切都在数据库中。

我们希望通过代码配置其中的某些设置,尤其是控制字段是否可编辑。

这可能吗?

应用启动时,浏览器向http://localhost:1337/content-manager/content-types/application::video.video(针对video内容类型)发出请求,这将返回一些metadatas,例如:

enter image description here

我在node_modules/strapi-plugin-content-manager/里闲逛,尝试看看是否有一种方法可以修改这些数据,但是我不知所措。

感谢任何指针,谢谢!

1 个答案:

答案 0 :(得分:0)

我不确定您需要什么,但是这里有一些trapi文档的链接,其中提供了更改默认行为的示例。

内容编辑器:
https://strapi.io/documentation/3.0.0-beta.x/guides/slug.html#configure-the-layout-for-the-content-editor

https://strapi.io/documentation/3.0.0-beta.x/guides/custom-admin.html#introduction

自定义数据响应:
https://strapi.io/documentation/3.0.0-beta.x/guides/custom-data-response.html

我相信您可以自定义很多皮带,可能需要一些时间来了解系统。