Setting folder collections path overrides slug value
- Dominant language
- JavaScript
- Stars
- 19.4k
- Forks
- 3.1k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 9
Description
**Describe the bug**
When using the [folder collections path](https://www.netlifycms.org/docs/beta-features/#folder-collections-path) option, the value of `slug` becomes that of `path` rather than just the slugified version of `title` or `identifier_field`.
**To Reproduce**
1. Create a collection and set `path` to `path: "{{slug}}/_index"`
2. Define a field for `title`
3. Create a new record
4. In a new collection create a relation widget and reference the original collection and set `valueField: {{slug}}`
5. Save a record in the new collection
**Expected behavior**
The value of of the relation widget to be just the slugified version of `title`, instead it's the entire path as defined in `path` (`my-title-slug/_index`).
**Screenshots**
**Applicable Versions:**
- Netlify CMS version: 2.10.55
**CMS configuration**
```
collections:
- name: "topics"
label: "Topics"
folder: "content/topics"
path: "{{slug}}/_index"
create: true
fields:
- label: "Topic Title"
name: "title"
widget: "string"
hint: "Short, topical, no acronyms."
- name: "events"
label: "Events"
label_singular: "Event"
folder: "content/events"
fields:
- label: "Topics"
name: "topics"
widget: "relation"
collection: "topics"
searchFields: ["title"]
valueField: "{{slug}}"
displayFields: ["title"]
```
Contributor guide
Assessment
This issue has not been assessed yet.