decaporg / decaporg/decap-cms

Nested collections (with i18n) create a broken filter on the left panel

Open
#6,974 1 comment 2 reactions 0 assignees View on GitHub
area: i18n type: bug
Dominant language
JavaScript
Stars
19.4k
Forks
3.1k
Avg merge
1d 14h
Merged PRs (30d)
9

Description

If I use a nested collection, the first item of the collection is displayed as a filter of the collection on the left panel. Only the first item is displayed, and as it is a file, it leads to an empty list.

Here is an example of the minimal config required:
``````yaml
collections:
- name: 'jury'
label: 'Jury'
label_singular: 'Jury member'
i18n: true
nested:
depth: 2
summary: '{{lastname}} {{firstname}}'
folder: 'content/jury' # The path to the folder where the documents are stored
create: true
summary: '{{lastname}} {{firstname}}'
slug: '{{lastname}}-{{firstname}}'
```

My folder structure is as follows:

```
jury
├── en
│ ├── 2021
│ │ ├── People1.md
│ │ ├── People2.md
│ │ ├── People3.md
│ └── 2024
│ └──People4.md
└── fr
│ ├── 2021
│ │ ├── People1.md
│ │ ├── People2.md
│ │ ├── People3.md
│ └── 2024
│ └──People4.md
```

In this example, People1.md would be displayed as a filter and clicking on it would lead to the relative URL `/admin/#/collections/jury/filter/2021`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.