decaporg / decaporg/decap-cms

automatic view filter from a relation

Open
#7,961 0 comments 0 reactions 0 assignees View on GitHub
type: feature
Dominant language
JavaScript
Stars
19.4k
Forks
3.1k
Avg merge
1d 14h
Merged PRs (30d)
9

Description

### Discussed in https://github.com/decaporg/decap-cms/discussions/7960

Originally posted by **gcolson** August 24, 2026
Hi,
I have a "vegetable" collection with a lot of objects that are related to another collection called "catalogue" that are categories of vegetables in which I display them (trees, herbaceous, vines, etc). I currently use the view_filters functionnality to filter the vegetables in the admin panel through their catalogues relation (for instance displaying only the vegetables that are related to trees by clicking to the "trees" filter).
To achieve this I had to manually create all the view_filters for each catalogue objects and I wonder if it would be possible (and not to much work) to add a functionality that allow to define view_filter from a relation field of a collection, with the same syntax as the relation widget.
I can imagine something like this in config.yml :
```
view_filters:
- type: "relation"
field: "catalogues"
pattern: "catalogues.slug"
name: "catalogue.name"
```
That would automatically fetch the catalogues that are related to the vegetable objects and add a view filters using the slug of the catalogues for each one that display the name of this catalogue.
One could even use a list field of catalogue to use them as filters, like with the relation widget. Something like
```
view_filters:
- type: "relation"
field: "catalogues"
pattern: "catalogues.subcatalogue.*.slug"
name: "catalogues.subcatalogue.*.name"
```

It seems to me that it would be quite usefull for many situations as relations often are a way to order and filter objects. I think for instance of the classic "author" / "post" example that is displayed as an example on the relation widget page of the docs. If there is a lot of books, one would like to filter them in the admin panel from the author to which they are related.

I hope that I made myself clear enough and that this functionnality does not already exists, if so I really did not find it.

Thanks for reading me

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.