Replies: 2 comments 1 reply
-
I don't think nested collections are supported. There are some workarounds I can think of, like using a single structured collection tree for all the items or creating a custom Laravel routes. If you explain your use case folks might suggest better ways though. If I missed your point you can have a look at all the Facades here: https://github.com/statamic/cms/tree/3.3/src/Facades |
Beta Was this translation helpful? Give feedback.
-
Generally, routing is managed by the collection. So the Statamic way to do what you want is a structured collection as you already figured out. However I don't think you can add files in sub directories and expect it to work by default, so unless someone can shed some light on which files you might need to override in order for it to keep working. If you are able to keep them in one directory you can check NavTree and CollectionTree repositories in order to access the tree or modify it. See how the CP does it in the controller: https://github.com/statamic/cms/blob/3.3/src/Http/Controllers/CP/Collections/CollectionTreeController.php |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm looking for a way to form a URL pattern that matches my file structure. Assuming automatic handling of nested collections is supported (by means of collections), how would I go about in doing that? For example, I would want an entry at
/parent-collection/sub-collection/entry-slug.md
to have an automatically-generated route of/parent-collection/sub-collection/entry-slug
.If a tree-like structure is only possible through Navigations, then what is the facade equivalent to templating? Yet, even if automatic handling of nested collections is supported, I would still like to know the facade equivalent. How do I query for a navigation?
Beta Was this translation helpful? Give feedback.
All reactions