Hi Luke,
assuming i understood correctly you could use this as a snippet:
<?php
if( !isset($resourceID) ) $resourceID = $modx->resource->id;
if( !is_numeric($rootID) )$rootID = $modx->getOption('site_start');
$parentIDs = $modx->getParentIDs($resourceID);
array_unshift($parentIDs,$resourceID);
return array_search( $rootID, $parentIDs );
you call it like this:
[[!getResourceLevel? &resourceID=`9` &rootID=`1`]]
resourceID is the ID of the document you want to get the level of. default is the current resource
rootID is the ID of the document that is the starting point of your tree / level 0. defaults to site_start
it returns 0 if rootID === resurceID, 1 if rootID is first parent etc, and false if rootID is not a parent of resourceID
*marc