-
-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Description
Only normal component fields are offered in the "Configure the view" interface for providing the Entry Title, it is not possible to select relation fields which often contain the descriptive information to distinguish components, and so the editor falls back to the very non-descript "id" attribute of the component.
Looks like this issue has come up before but I don't see any solutions/workarounds shared and while there seem to be attempts to fix this for list views, I haven't found any efforts to improve on the editing experience.
Steps to reproduce the behavior
- Create a new content type
- Add a new repeatable component
- The component should have a relation to another content type (one-way or 1:1 relation to exactly one item)
- In the content type editor, click "Customize the View"
- On the Customize screen select "Set the component's layout" under the component with the relation field
- the "Entry Title" dropdown doesn't offer the relation view (or any fields on the other side of the relation)
Expected behavior
At least normal string fields on the other end of the relation should be selectable (e.g. a person relation should expose person.name as an Entry Title for a component with a person relation).
Screenshots
Only the strapi-generated unique id and the role (string) field can be selected as "Entry Title", but those are not useful, a person.name on the other end of the relation is a descriptive field of the component, the ID is opaque, while role can be the same across instances of the component (or, in this case, even empty for "default" roles).
The people-involved component type:
Code snippets
The people-involved model descriptor:
{
"collectionName": "components_people_people_involveds",
"info": {
"name": "people involved",
"icon": "user-friends"
},
"options": {},
"attributes": {
"person": {
"model": "people"
},
"role": {
"type": "string"
}
}
}The people collection type on the other end of the relation:
{
"kind": "collectionType",
"collectionName": "people",
"info": {
"name": "People"
},
"options": {
"increments": true,
"timestamps": true
},
"attributes": {
"name": {
"type": "string"
},
"email": {
"type": "email"
},
"bio": {
"type": "text"
},
"photo": {
"model": "file",
"via": "related",
"allowedTypes": [
"images",
"files",
"videos"
],
"plugin": "upload",
"required": false
},
"identities": {
"type": "component",
"repeatable": true,
"component": "people.identity"
}
}
}System
- Node.js version:
v12.18.4 - NPM version:
v12.18.4 - Strapi version: 3.1.4
- Database: postgres
- Operating system: Ubuntu 20.04.1 LTS (GNU/Linux 5.4.0-26-generic x86_64)

