decaporg / decap-cms

A Git-based CMS for Static Site Generators
https://decapcms.org
MIT License
17.7k stars 3.03k forks source link

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

Open Billybobbonnet opened 8 months ago

Billybobbonnet commented 8 months ago

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:

  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