This is an ancient topic but I needed an answer to this exact question and now that I have one I’ll share it here.
Actually it’s a simple problem. Just:
1. Make a template variable (tv) that will identify the resources you want excluded. I chose a drop down list with
Show==1||Don’t Show==2 kinda thing.
2. Make a snippet that grabs the IDs of the resources that should be excluded based on the tv from the database. I hacked this from something else I found somewhere in the forum, forget where now:
/* build a query to get Resources with a TV id of 2 that are published and not deleted */
$query = $modx->newQuery('modTemplateVarResource', array('tmplvarid' => 1, 'value' => 2));
/* to optimize, you can select only the columns you need */
$query->select($modx->getSelectColumns('modTemplateVarResource', 'modTemplateVarResource', '', array('id', 'contentid', 'value')));
/* get the modTemplateVarResource objects with a TV id of 1 */
$children = $modx->getCollection('modResource', $query);
/* loop through the children and push the id onto $resourceIds */
$resourceIds = array();
foreach ($children as $child) {
$resourceIds[] = $child->get('contentid');
}
return implode(',', $resourceIds);
NOTE: You’ll have to go into the database to dig up the
’tmplvarid’ => 1 part on your own. The number is the ID of your template var. There’s a table for template variables that shows IDs, maybe there’s a way to refer to it directly. Not sure myself!
3. Include an excludeDocs parameter in your Wayfinder call, and insert the snippet as the passed value. Like so:
[[!Wayfinder? ...&startId, &level, etc... [color=red]&excludeDocs=`[[your_snippet_name_here]]`[/color]]]
Done!
And for people like me who were very confused for several weeks: This is for Revolution! Evo will take a tweek or two.