自定义Strapi现场标签

发布于 2025-02-04 02:21:39 字数 2109 浏览 3 评论 0原文

我有一个代表一个集合的strapi模型,该集合由以下JSON指定:

{
  "kind": "collectionType",
  "collectionName": "orgs",
  "info": {
    "name": "Organization",
    "description": ""
  },
  "options": {
    "increments": true,
    "timestamps": true,
    "draftAndPublish": false
  },
  "attributes": {
    "backToTopButton": {
      "type": "BackToTopButton",
      "columnType": "object"
    },
    "relationNavigation": {
      "type": "RelationNavigation",
      "columnType": "object",
      "entityUid": "communities",
      "selectedIndex": 0,
      "items": [
        {
          "relationEntityUid": "orgs",
          "label": "Information",
          "value": "Community",
          "localKey": "communityId",
          "foreignKey": "communityId",
          "relationType": "OneToOne"
        },
        {
          "relationEntityUid": "Connectorsetting",
          "label": "",
          "value": "Connectors",
          "localKey": "communityId",
          "foreignKey": "communityId",
          "relationType": "OneToOne"
        }
      ]
    },
    "yglId": {
      "type": "number"
    },
    "name": {
      "type": "string"
    },
    "segmentType": {
      "type": "DropDown",
      "columnType": "string",
      "stretchType": "half",
      "cssOverride": false,
      "options": ["Strategic 1", "Strategic 2", "Strategic 3", "SBAM", "Self Serve"]
    },
    "reportingSuite": {
      "type": "DropDown",
      "columnType": "string",
      "options": ["Strategic A", "Strategic B", "Strategic C", "Strategic D", "Strategic E", "Strategic F", "Strategic G", "Strategic H", "Strategic I", "Strategic J", "SBAM", "SBAM A", "SBAM B", "SBAM C"]
    }
  }
}

我必须具有自定义标签,例如,对于属性 - sementType我很想能够写“组织”段“

理想情况下,我正在寻找一种类似的方法来重写:

"segmentType": {
  "type": "DropDown",
  "columnType": "string",
  "stretchType": "half",
  "cssOverride": false,
  "options": ["Strategic 1", "Strategic 2", "Strategic 3", "SBAM", "Self Serve"],
  "label": "organization segment"
},

我找不到任何仅使用JSON而在不编码[插件]的情况下进行此操作的示例。

任何援助都将不胜感激。

I have a strapi model representing a collection, specified by the below JSON:

{
  "kind": "collectionType",
  "collectionName": "orgs",
  "info": {
    "name": "Organization",
    "description": ""
  },
  "options": {
    "increments": true,
    "timestamps": true,
    "draftAndPublish": false
  },
  "attributes": {
    "backToTopButton": {
      "type": "BackToTopButton",
      "columnType": "object"
    },
    "relationNavigation": {
      "type": "RelationNavigation",
      "columnType": "object",
      "entityUid": "communities",
      "selectedIndex": 0,
      "items": [
        {
          "relationEntityUid": "orgs",
          "label": "Information",
          "value": "Community",
          "localKey": "communityId",
          "foreignKey": "communityId",
          "relationType": "OneToOne"
        },
        {
          "relationEntityUid": "Connectorsetting",
          "label": "",
          "value": "Connectors",
          "localKey": "communityId",
          "foreignKey": "communityId",
          "relationType": "OneToOne"
        }
      ]
    },
    "yglId": {
      "type": "number"
    },
    "name": {
      "type": "string"
    },
    "segmentType": {
      "type": "DropDown",
      "columnType": "string",
      "stretchType": "half",
      "cssOverride": false,
      "options": ["Strategic 1", "Strategic 2", "Strategic 3", "SBAM", "Self Serve"]
    },
    "reportingSuite": {
      "type": "DropDown",
      "columnType": "string",
      "options": ["Strategic A", "Strategic B", "Strategic C", "Strategic D", "Strategic E", "Strategic F", "Strategic G", "Strategic H", "Strategic I", "Strategic J", "SBAM", "SBAM A", "SBAM B", "SBAM C"]
    }
  }
}

I have to have custom labels, for example, for the attribute - segmentType I would love to be able to write "organization segment".

Ideally, I am looking for a way to rewrite this similar to:

"segmentType": {
  "type": "DropDown",
  "columnType": "string",
  "stretchType": "half",
  "cssOverride": false,
  "options": ["Strategic 1", "Strategic 2", "Strategic 3", "SBAM", "Self Serve"],
  "label": "organization segment"
},

I could not find any examples of how to do this without coding [a plugin], using just the JSON.

Any assistance is appreciated.

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

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

发布评论

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

评论(1

十六岁半 2025-02-11 02:21:39

您可以通过视图配置接口实现此目标。
要进入此接口,只需转到集合/单个类型,然后单击“配置视图”按钮。
请参阅此屏幕截图以获取参考

当您在视图配置接口中时,请单击铅笔图标。您要编辑标签的字段。
请参阅此 ScreenShot以获取参考

You can achieve this through the View Configuration interface.
To get to this interface, just go to the Collection/Single type then click the “Configure the view” button.
See this Screenshot for Reference

When you are in the View Configuration interface, click the pencil icon on the field with which you want to edit the Label.
See this Screenshot for Reference

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