-
-
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
Make nested collections work with a flat content structure #4972
Comments
Hi @martinjagodic, thank you for opening the issue. This would be great to have. Would the logic be to treat any non |
@erezrokah yes, this is how I imagine it. |
I'd also love to see this feature! |
@erezrokah Can you outline the expected work for this feature? Trying to gauge what the commitment would be in case I have time to contribute. |
Hi @dylanirlbeck, thanks for initiating! I would classify this as medium size effort for someone who is not familiar with the CMS codebase. The relevant code is here: To resolve the issue we would need to consider file siblings of |
I had a quick look at what the current behaviour is. Looks like non index files are currently shown one level higher than they should be in the entries listing. One open question is probably if non index files should also show up in the menu structure. What should happen if you click one of those files, would you be able to create new files in that position of the structure. Should the underlying system convert the single file to the folder structure if you do? |
I would also love to see such a feature added.
Could it be possible to simply extend the behavior of
With this solution it could be possible to enable custom file names and flat hierarchies in subfolders without much effort? @erezrokah |
Thanks @tangleMesh, with your suggestion - what would be the index file I think the logic to implement is still this one:
That is, the index file is the parent, and any sibling is a child. If anyone wants to contribute, the code is here: |
👋 Hiya! I’d love to take a pass at implementing this — @eric-gade and I are finding a need for it on a current project. We poked around a bit, and have also come across the index.md issue being discussed. I think what makes the most sense (to me, at least) is, for nested collections, always show folders in the left navigation and only immediate children of that folder as pages in the main list view. Here’s a few examples — I’ll note that this goes against the idea of "filtering" as implied by the URL structure of "filter" but seems to be the simplest:
(and so on — the pattern repeats recursively). The effect of this behavior change:
I think I have this mostly implemented, but will button it up tomorrow and send a pull request over if I don’t hear any significant objections. 🙂 |
This commit fixes decaporg#4972 to allow nested folders with additional content beyond an index file. Side effect: To keep the feature simple, this will now show index files as pages within a folder in NetlifyCMS. This enables creating additional files alongside the given index, but is a change in behavior from the current implementation. Co-authored-by: Eric Gade <[email protected]>
This commit fixes decaporg#4972 to allow nested folders with additional content beyond an index file. Side effect: To keep the feature simple, this will now show index files as pages within a folder in NetlifyCMS. This enables creating additional files alongside the given index, but is a change in behavior from the current implementation. Co-authored-by: Eric Gade <[email protected]>
As discussed in #4969, I would like to see nested collections work with the flat content structure.
Currently, nested collections work with only one type of content structure, where every markdown file has to be in its own folder:
I would like to see it work also with a flatter structure, like this one:
The text was updated successfully, but these errors were encountered: