Unable to access multiple objects from the same file collection
- Dominant language
- JavaScript
- Stars
- 19.4k
- Forks
- 3.1k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 9
Description
**Describe the bug**
I have a file with multiple objects, as such:
```yml
# my-collection.yml
first:
# stuff nested here
second:
# more stuff here
third:
# more stuff here
```
I set this up as a file collection in the CMS, for instance:
```yml
# config.yml
collections:
- name: 'my_collection'
label: 'My collection'
files:
- label: 'First'
name: 'first'
file: 'my-collection.yml'
fields:
# many fields here
- label: 'Second'
name: 'second'
file: 'my-collection.yml'
fields:
# many fields here
```
Then I go check the CMS under "My collection" and I have:
* First
* First
Seems to me that if I'm adding the same file under the same collection, it reuses the first occurrence of that file as many times as the number of entries under `files`.
To overcome this issue I'm creating multiple collections, each with 1 file, which seems inappropriate to me.
**To Reproduce**
Follow the set up described above 👆
**Expected behavior**
I would expect to have this list under "My collection":
* First
* Second
**Applicable Versions:**
- Netlify CMS version: 2.10.66
- Git provider: GitHub
- OS: macOS Catalina (10.15.6)
- Browser version: Brave 1.14.84
- Node.JS version: 12.17.0
**CMS configuration**
See above 👆
Contributor guide
Assessment
This issue has not been assessed yet.