I could be wrong, but I don't think Wayfinder will do this. Even if it could, this would probably be quicker and easier:
<?php
/* ShowAllResources Snippet */
$query = $modx->newQuery("modResource");
$query->select(array(
'id' => 'id',
'pagetitle' => 'pagetitle',
'published' => 'published',
'deleted' => 'deleted',
));
$query->where(array('published' => '1', 'deleted' => '0'));
/* uncomment the next line if you want them sorted */
// $query->sortby('pagetitle', 'ASC');
$results = array();
if ($query->prepare() && $query->stmt->execute()) {
$results = $query->stmt->fetchAll(PDO::FETCH_ASSOC);
}
$output = "\n" . '<ul class="sa_resources_ul">';
foreach($results as $doc) {
$output .= "\n " . '<li class="sa_resources_li"><a href="[[~' . $doc['id'] . '"]]>' . $doc['pagetitle']. '</a></li>';
}
$output .= "\n</ul>";
return $output;
I'm assuming that you want them to be links.
It's very easy to sort them alphabetically by pagetitle, by createdon, by editedon, by menuindex, or by published date if you like, and shouldn't make it noticeably slower. You could also wrap it with getPage if you have a lot of resources and want to let the user page through them.
FYI, there is also the SiteAtoZ snippet, but the code above will be a lot faster.
[ed. note: BobRay last edited this post 11 years, 11 months ago.]