-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft: Nested collections #3227
Comments
Hey @erquhart, this is all a great request. I am following along with this and with #341 as my project requires admins (non-developers) to create / edit new pages at will (ideally with customization about their position in the directory). Looks like request #341 has been in consideration for a while. Any prospective solution for it in the near future? Any current workarounds? Thanks for your hard work and cheers man. |
Hi @BranonConor, we try to handle most up voted issues first so best thing to do is up vote #341. |
Voted, but also wanted to voice support for this feature…we're doing quite a bit of hoop-jumping to get around the limitation of no nested dirs in folder collections |
Hi! @erezrokah Question in regard file structure mentioned above, would structure like that work?
A mix of regular pages and |
After setting meta path in collection config:
I get this error every time I try to save existing content:
I'm using gitlab backend with netlify cms application to log in. If I comment line with meta.path, I can save and work with content as expected, but I'm not able to move content to different folders. With github backend it works as expected. |
After my testing, for Hugo you can use only folder/_index.md for every page |
Please see the description of the feature/assumptions here #3716 I'll update the docs with the expected structure. If you have any issues, please open a new issue with a reproduction since it makes it easier to track things. |
Is there a way for the path field to be optional? Like if I don't provide a path it would default to the root, or am I missing something? It'd be great if this were a select or combobox field to select an existing page as the parent, but I'll assume it's been considered. |
Is that |
Setting it to an empty value should write the index file at the top level.
You can use any widget, for example we have an experimental parent widget:
Kind of new, it was used a long time ago and deprecated. Now it's only used for nested collections |
Thanks for the response. When I try to create a new page I get this error
I have this configuration allow_nesting: true
# adding a meta object with a path property allows editing the path of entries
# moving an existing entry will move the entire sub tree of the entry to the new location
meta: {
path: {
widget: string,
label: 'Path',
index_file: '_index'
}
} |
Hmm, maybe I didn't remember correctly, can you try setting it to |
If I open an existing page, such as
I'm using the CDN which appears to be pulling in this script: https://unpkg.com/[email protected]/dist/netlify-cms.js Not sure if I need a Thanks for the assistance. |
No need for a beta version - how about opening a new issue with a reproduction? |
Issue posted: #4317 |
Is your feature request related to a problem? Please describe.
A site's page hierarchy can require pages and groups of pages to be created in a nested structure. A content editor working with such a site may need to:
Netlify CMS allows new entries to be created in folder type collections, but all entries are more or less siblings in the collection folder. Collections must be added to the CMS configuration for each level of hierarchy.
Describe the solution you'd like
Known use cases involve a single collection description requiring hierarchy only - not distinctly defined collections within other collections. Satisfying this feature request should be doable by simply "enabling nesting" on a folder collection.
Configuration
allow_nesting
property totrue
on a collectionmax_depth
setting limiting how deep the hierarchy can gomax_depth
should default to something sane like3
max_depth
should have an internally enforced and documented limit, maybe5
label_singular
can apply to all nested directoriesUI
Stretch Goals
Implementation Considerations
/edit/
route, the entryName segment currently refers to the filename, but should refer to the path from collection folder to file for nested collectionsOpen Questions
_index.md
orindex.md
file at each level, ideally we could pull values from there for string replacements in thelabel
anddescription
fields.Describe alternatives you've considered
Additional context
Related to:
#513
The text was updated successfully, but these errors were encountered: