getChildren limit contentTypes just like query

So just in case some future “less than informed” content editor person, puts something into my folder, that should not be there, I can choose to only care about what I want to care about in my code.

Saying what content is allowed in a folder could be a nicer approach, but I think I have requested that earlier.

1 Like

I’ve been asking for this since day 1. In fact, I don’t think I’ve ever used getChildren because it’s useless without being able to limit results to a specific type of content. It’s best to just use content.query and then specify the path starts-with and contentTypes.

1 Like

THIS. At least until there is a better alternative.

But I think sort: ‘_manualordervalue DESC’ only works with getChildren… not query, so since manual sort order is very important in this instance, I cannot use query. And thus the only workaround is to filter the result from getChildren :frowning:

_manualordervalue is available for search-expressions also:

http://xp.readthedocs.io/en/latest/developer/search/indexed-content-properties.html