Skip to content
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

Allow nested collections (#1400) #1539

Merged
merged 5 commits into from Mar 11, 2019

Conversation

@distantnative
Copy link
Contributor

commented Mar 5, 2019

Describe the PR

Allows collection files to be placed inside the collections folder as well as one subdirectory lower:

collections/
∟ folder/
  ∟ name.php

to be called by $kirby->collection('folder/name').

Related issues

@bastianallgeier
Copy link
Contributor

left a comment

We can't use GLOB_BRACE as it is not available on Windows :( I also think that I didn't implement collection loading in a good way. It shouldn't be necessary to scan the collections folder in order to get a single collection. It would be better if we refactor it first and then implement the feature.

@distantnative

This comment has been minimized.

Copy link
Contributor Author

commented Mar 6, 2019

Let's rather reopen this and keep working on it ;)
I thought about only loading an individual collection on the ->get() call, but didn't want to change too much. But in that case then let's rewrite the whol load part.

@distantnative distantnative reopened this Mar 6, 2019

@distantnative

This comment has been minimized.

Copy link
Contributor Author

commented Mar 6, 2019

@bastianallgeier Ping - I added a suggestion how to refactor the class, only loading a collection file once it is requested.

@bastianallgeier bastianallgeier force-pushed the feature/nested-collections branch from 1361565 to b0d1152 Mar 11, 2019

@bastianallgeier bastianallgeier merged commit a10be9f into develop Mar 11, 2019

0 of 2 checks passed

Travis CI - Pull Request Build Errored
Details
Travis CI - Branch Build Failed
Details

@bastianallgeier bastianallgeier deleted the feature/nested-collections branch Mar 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.