自定义Strapi现场标签
我有一个代表一个集合的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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以通过视图配置接口实现此目标。
要进入此接口,只需转到集合/单个类型,然后单击“配置视图”按钮。
请参阅此屏幕截图以获取参考
当您在视图配置接口中时,请单击铅笔图标。您要编辑标签的字段。
请参阅此 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