ProcessWire that lets you return a page's depth relative to the root, to a parent or a closest matching selector.