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

Using @page: / to get collections #341

Closed
stell opened this issue Oct 1, 2015 · 2 comments
Closed

Using @page: / to get collections #341

stell opened this issue Oct 1, 2015 · 2 comments

Comments

@stell
Copy link
Contributor

stell commented Oct 1, 2015

It would be a great to be able to get all pages by using @page: /
Also to be able to get not only children of the current hierarchy level but all beneath it when using @page: /level2.

@rhukster
Copy link
Member

I have added support for this via:

077ba28

Basically you can now get the root page with:

content:
    items: 
        '@page': '@root'

This is because @page: / is actually an alias to the homepage, and the homepage may have children but is not really the root of all pages. The homepage could could be any page in grav as it's configurable.

Also I added support for an extra param like this:

content:
    items: 
        '@page': ['@root', true]

When set to true, all pages below will be included. This also works for regular pages:

content:
    items: 
        '@page': ['/blog', true]

Combined with the new multi-collection support (#361), page collections are now much more flexible.

Docs will be updated after this release

@stell
Copy link
Contributor Author

stell commented Oct 19, 2015

Sounds great! Will check it out soon. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants