Jump to content

Is there a "children.count" property for selectors that accounts for visibility?


Recommended Posts

Here's my query:

$pages->find("template=collection, sort=-children.count");

However it is sorting my collections based on the total number of children. I've searched all over and cannot find a way to take visibility into account for this property. (I don't want to include any hidden or unpublished children). 

While rendering the child items in the html, I use


to show the number of visible, published children. But the sorting is all messed up because it includes all the hidden and unpublished.


There's got to be some way to find the count of  visible children in an efficient manner, without retrieving every single record to check it with a for loop??

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...