-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
id widget #3712
Comments
Thanks @magomimmo, will this be covered by implementing #1975 along with using the |
I'm using @d4rekanguok 's |
With the recent addition of being able to use string templates with the relation widget, I think the only missing feature is to target a specific file (correct me if I'm wrong). As for the Id widget, the main use case for it is with the relation widget, which you can now set I agree the CMS should supply a built in Id widget functionality and have an option to hide any widget. Clarifying my suggestion - supporting a built in Am I making sense here? |
This would make sense yes. |
Agree, but we should be able to unify the corresponding configuration options
It makes sense
Yes, it makes a lot of sense. |
Just adding the following note on the this discussion. As said in a previous post I use While using the Here is the minimal case: # Referenced folder colleciton
- label: Referenced Folder collection
name: referenced
identifier_field: id
folder: content/referenced
create: true
slug: '{{year}}{{month}}{{day}}{{hour}}{{minute}}{{second}}-{{last}}-{{first}}'
summary: '{{last}}, {{first}}'
editor:
preview: false
fields:
- label: ID
name: id
widget: ncw-id
- label: Last Name
name: last
widget: string
- label: First Name
name: first
widget: string
- label: Referencing Folder Collection
name: referencing
identifier_field: id
folder: content/referencing
create: true
slug: '{{year}}{{month}}{{day}}{{hour}}{{minute}}{{second}}-{{referenced.last}}'
summary: '{{referenced.last}}, {{referenced.first}}-{{referenced}}'
editor:
preview: false
fields:
- label: ID
name: id
widget: ncw-id
- label: Referenced Entry
name: referenced
widget: relation
collection: referenced
searchFields: ['last', 'first']
displayFields: ['{{last}}, {{first}}']
valueField: id As you can see in the attached screenshot, the summary of the referencing collection can only show the HIH |
Thanks @magomimmo, that's actually a though one. The CMS only stores the |
Ugh. @erezrokah that's a pity. What about to save the summary of the referenced entry in the |
As long as you are sure the I actually think a better approach is to allow users to customise the cards #2868 (comment). |
Thanks @erezrokah |
Hello @erezrokah 👋 If I read well your last message, it seems possible to use a template in the My need is the same that this issue: I have a file collection with fields value_field: 'a is {{mylist.*.a}} - and b {{mylist.*.b}}'
search_fields: ['mylist.*.a', 'mylist.*.b'] With the following, I have my items properly displayed: value_field: 'mylist.*.a'
search_fields: ['mylist.*.a', 'mylist.*.b'] Did this feature disappear, or do I miss something? |
Hi @vnourdin, this seems like a bug/something we missed when implementing the wildcard access pattern via I suggest opening a new issue so we can look into it. A better way to approach it is to create a uniquely identified field in |
I open a new issue then. I did that with the |
Is your feature request related to a problem? Please describe.
Whenever you model a collection you need an identifier field for its entries. Most of the time the collection does not have a natural identifier field (i.e. a primary key in RDBMS parlance). For this reason the community developed a range of custom widgets to fill this hole in the NetlifyCMS standard widget library, that does not offer such a basic widget.
Describe the solution you'd like
Create an
id
widget to generate an universal unique id code (i.e. UUID). This widget should also have a booleanhide
option to allow the associatedfield
to be hidden from the UI.Describe alternatives you've considered
Use a community based custom widget, but none of them currently allows to hide the field from the UI.
Additional context
Anyone intending to migrate a three-tire web application to JAMstack architecture will need to model collections and collection relationship. And you can't do this without having an
id
widget resembling synthetic primary key in RDBMS parlance.The text was updated successfully, but these errors were encountered: