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

Should children.count() includes pages that are invisible? #61

Closed
gosdenj opened this issue Sep 25, 2014 · 1 comment
Closed

Should children.count() includes pages that are invisible? #61

gosdenj opened this issue Sep 25, 2014 · 1 comment

Comments

@gosdenj
Copy link

gosdenj commented Sep 25, 2014

Is it possible to get a total count of child pages where visible is "true"? At present the children.count() returns the total number of pages regardless of whether they are visible or not.

One scenario where this maybe useful is when using a navigation menu (that supports drop-downs) and you don't want to include child pages in the drop-drown structure (e.g. blog articles etc.)

@rhukster
Copy link
Member

Fixed in commit: e4ff2ea

I've added a couple of filters to Collection, so you can do something like:

page.children.visible|length (twig)

or

$page->children()->visible()->count() (php)

Also added routable() filter as well

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

3 participants