Update:
For those looking to use Wayfinder 2.0 with Unpublished Documents, here is a preliminary patch that seems to do the trick. Please note, this has not been tested in more advanced, deeply nested list situations. It simply introduces the hideUnpublished parameter. If defined w/ a value of 0, Wayfinder will include unpublished documents from the current branch within the result set.
2 simple patches:
Edit
assets/snippets/wayfinder/wayfinder.inc.php: (Line 351)
1. Replace:
$sql = "SELECT DISTINCT {$fields} FROM {$tblsc} sc LEFT JOIN {$tbldg} dg ON dg.document = sc.id WHERE sc.published=1 AND sc.deleted=0 AND ({$access}){$menuWhere} AND sc.id IN (".implode(',',$ids).") GROUP BY sc.id ORDER BY {$sort} {$this->_config['sortOrder']} {$sqlLimit};";
With:
// pixelchutes - Work with unpublished documents - 6:19 PM 8/25/2007
$sql = "SELECT DISTINCT {$fields} FROM {$tblsc} sc LEFT JOIN {$tbldg} dg ON dg.document = sc.id WHERE sc.published<>".( $this->_config['hideUnpublished'] ? 0 : 2 )." AND sc.deleted=0 AND ({$access}){$menuWhere} AND sc.id IN (".implode(',',$ids).") GROUP BY sc.id ORDER BY {$sort} {$this->_config['sortOrder']} {$sqlLimit};";
//$sql = "SELECT DISTINCT {$fields} FROM {$tblsc} sc LEFT JOIN {$tbldg} dg ON dg.document = sc.id WHERE sc.published=1 AND sc.deleted=0 AND ({$access}){$menuWhere} AND sc.id IN (".implode(',',$ids).") GROUP BY sc.id ORDER BY {$sort} {$this->_config['sortOrder']} {$sqlLimit};";
2. Edit
Wayfinder snippet: (v2.0/MODx v0.9.6 - Line 61)
Add the following new parameter to
Line 61
'hideUnpublished' => isset($hideUnpublished) ? $hideUnpublished: TRUE, // pixelchutes - work with unpublished documents
That's it!
Simply pass hideUnpublished in your Wayfinder snippet call:
[[Wayfinder? &hideUnpublished=`0` &startId=`[*id*]`]]
with your snippet call to include Unpublished Documents with Wayfinder!
* Further testing in more advanced scenarios should take place to confirm desired functionality