statamic / ideas

šŸ’”Discussions on ideas and feature requests for Statamic
https://statamic.dev
32 stars 1 forks source link

Collections that respect filesystem hierarchy #1248

Closed efc closed 3 weeks ago

efc commented 3 weeks ago

Statamic already seems to not be bothered if I plop a bunch of content organized into folders into an existing collection. However, it does not recognize that folder structure as a tree hierarchy and whenever I edit one of the files with the UI the file gets plucked out of its parent folder and placed into the root of the collection. This gets awkward when importing already structured directories of information into Statamic.

It would be great to have a collection type with a variation on the "orderable" option that would move files between folders as they are moved in the statamic structure. I imagine an option on "orderable" that says something like "reflect order in filesystem". This option might also generate the initial tree based on the filesystem path of any newly discovered file.

In fact, automatically creating a tree based on folder structure, when files are found to be in folders, might be an idea all on its own. This could be very helpful even if the folder structure was not respected moving forward.

In any case, as someone bringing a lot of already "structured" markdown content from a Jekyll site to Statamic, it would be great if Statamic had a way of at least building trees from and existing folder structure and perhaps even keeping that structure intact as the user makes changes to the tree with the UI.

jackmcdade commented 3 weeks ago

I would love to have this too. It's actually how Statamic v2 worked, but to simplify a lot of things we dropped it. I'd still like to have it again tho!

efc commented 3 weeks ago

As I was thinking about this over the weekend I realized this is important for another reason... simplicity and sustainability of data migration. If I ever decide to migrate out of Statamic, having an intact folder structure would make migration vastly simpler.

Right now, as someone new to Statamic and considering adoption, the fact that it obscures the structure of my data in the filesystem makes it feel like a bit of a dead end. Getting into Statamic will be much easier than getting out of it. Data I bring in will be obscured and structure made opaque to simple unix tools and scripts. I even get frustrated that the structure is missing when I glance at my entries in VS Code's sidebar! This gives me pause.

If Statamic had an option to respect and preserve the filesystem structure alongside its own trees, I would gain confidence that Statamic was "future proof." That I could carry forward the data I build in Statamic even if I move on to another tool.

I am just arriving to this community now, I had no idea Statamic used to work this way. I think it is important to consider an option to allow this again.

jasonvarga commented 3 weeks ago

Basically a duplicate of https://github.com/statamic/ideas/issues/85

efc commented 3 weeks ago

So does the fact that this issue is now "closed" mean that there is no further consideration of this idea? Just asking so that I know how much hope to hold out.

andjsch commented 3 weeks ago

So does the fact that this issue is now "closed" mean that there is no further consideration of this idea? Just asking so that I know how much hope to hold out.

Nope. It was a duplicate of another issue. It can be tracked on #85.

efc commented 3 weeks ago

Oops, I read issue #85 as closed, but now I see it is open and I was just seeing the "closed" tag for this issue over there. Sorry!