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
Merged

Conversation

distantnative
Copy link
Member

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

@distantnative distantnative added type: enhancement ✨ Suggests an enhancement; improves Kirby status: to review 👀 labels Mar 5, 2019
@distantnative distantnative self-assigned this Mar 5, 2019
Copy link
Member

@bastianallgeier bastianallgeier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Member Author

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
Copy link
Member Author

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

@bastianallgeier bastianallgeier merged commit a10be9f into develop Mar 11, 2019
@bastianallgeier bastianallgeier deleted the feature/nested-collections branch March 11, 2019 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement ✨ Suggests an enhancement; improves Kirby
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants