This repository has been archived by the owner on Sep 9, 2024. It is now read-only.
Feature: grouped collections #316
Skrubbadubba
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The idea is that you could group multiple different collections inside collections. This would replace, or maybe you could say be another iteration of, nested collections. Obviously, you would only be able to create entries at the deepest level of the collections tree, i.e you shoudn't be able to create collections as entries, im just suggesting to be able to group them.
I made another suggestion here #315, about headers. Having headers would help with visual grouping, and is (I'm guessing) way more efficient in terms of cost of development/UX improvement, but being able to hide collections within dropdowns is certainly an improvement over that.
What this would add over current nested collections:
Currently nested collections expects a certain folder structure:
Grouped collections would allow any folder structure, for example:
which obviously improves flexibility but also makes adding staticCMS to an already existing project much easier. A project with a lot of content already added might require a lot of monotonous work just renaming files and creating folders to get working with nested collections
Grouped collections would also allow differently configured collections to be grouped. This would be very useful, say if you wanted a collection for your site's pages, but some pages need another set of fields because they have a special layout or componentry (like a landing page for example). It would also allow having, say, a file collection with settings over a group of similar pages be close both visually and in terms of "clicks away" to the folder collection with those pages.
This would be a new collection type, besides file and folder collections, and be defined with a special
collections
option.Speaking from inexperience, it sounds to me like it wouldn't be the hardest thing to implement - not a lot of backend stuff. Since regular, already functional collections - the ones at the deepest level of the collection group - would handle actually creating and editing entries, the only thing that needs adding development-wise is being able to read a config.yaml with grouped collections, and using the dropdown UI feature already used by nested collections to group them.
Additional suggestions:
The ability to create collection "templates". That way you wouldn't need to copy paste a bunch of similar collections with different names inside a collection group, You could just configure different
name
,label
, andfolder/file
and apply a predefined set of fields.Also, with this in place, it would actually be possible to create collections as entries inside a collection group. The most obvisouly use case being creating a new page route with it's own sub pages, insides a "pages" collection. Otherwise functionality would be limited to only creating new pages at the deepest level of the already existing sitemap.
With all of this in mind, this is how a config.yaml could look:
IMO this is the way netlify-CMS should have implemented nested collections to begin with.
Beta Was this translation helpful? Give feedback.
All reactions