<?php
if (array_key_exists($uri, $modx->aliasMap)) {
$resourceId = $modx->aliasMap[$uri];
}
This must be the complete URI relative to the Context's base_url and including the Content Type extension or container_suffix, i.e. if the URL to your site is
- http://domain.tld/path/to/resource.html
then the URI to search for would be
- path/to/resource.html
You can do the same for Resources in other Contexts as well: