pepebe
3/16/2012 - 10:06 AM

MODX.Snippet: Return document depth

MODX.Snippet: Return document depth

<?php
/* Return document depth
 * Author: Aaron Ladage - eatsleepmodx.com
 * Published: http://www.gregorysmart.com/2010/05/27/guest-post-count-levels-in-modx/  
 * */
$output = '';
$id = $modx->documentIdentifier;
$levelcount = count($modx->getParentIds($id));
$output .= $levelcount;
return $output;
?>