Wayfinder can only exclude a single fixed list of document ids. It would be cool if it could have more advanced filters like Ditto. Is anything like this planned? it would be more elegant than my crude solution:
I needed a way to exclude some docs from my sitemap according to their template id. This quick utility snippet solved it for me. It uses hardcoded template ids but could be tweaked to work with parameters or different columns of the site_content table.
<?php
// snippet getExcludesSitemap
// works with hardcoded id's in select (here template 9 and 16 are used for excluded list)
$res = $modx->db->select("id", $modx->getFullTableName('site_content'),
"template = '9' OR template = '16'");
$count = $modx->db->getRecordCount($res);
if($count)
{
$i = 0;
$output;
while( $row = $modx->db->getRow( $result, 'id' ) ) {
$output .= $row['id'];
$i++;
if ($i < $count)
$output .= ",";
}
}
else $output = '';
return $output;
?>
One could use it in a Wayfinder call like on a site of mine:
[!Wayfinder? &startId=`0` &excludeDocs=`[[getExcludesSitemap]]` &ignoreHidden=`1`!]