You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be cool if we could find pages by depth (the number of parents).
Example:
$tier_three_pages = $pages->find("depth=3");
And this would potentially be a lot more efficient than looping over $page->children and $child->children when dealing with large numbers of descendants:
// I know it's possible to work out depth via $page->parents->count // but might as well have depth as a property if the parent count is going to be stored in the DB anyway$min_depth = $page->depth + 1;
$max_depth = $page->depth + 2;
$children_and_grandchildren = $page->find("depth>=$min_depth, depth<=$max_depth");
Short description of the enhancement
It would be cool if we could find pages by depth (the number of parents).
Example:
And this would potentially be a lot more efficient than looping over $page->children and $child->children when dealing with large numbers of descendants:
Related forum topic: https://processwire.com/talk/topic/15105-why-isnt-there-a-page-level-property/
The text was updated successfully, but these errors were encountered: