I'm using getResource and I would like to retrieve resource's level to create conditions. I found an old script but it does not work anymore with modx 2.4.2:
<?php
/*GetLevel snippet */
$parentIds = $modx->getParentIds($modx->resource->get('id'))
return count($parentIds);
It crashes the website. Can someone help or update the code above? Thank you!
It was just missing a semicolon :