Hi, just bumped into your question. Had exactly the same question the other day and came up with this snippet:
<?php
//Snippet WebLinksList
//Container Document, defaults to site root (work through full doc tree) if none given
$container = isset($container) ? $container : 0;
//Depth to search for children documents, defaults to 1 if none given
$depth = isset($depth) ? $depth : 1;
//Fetch Children documents
$res=$modx->getChildIds($container, $depth);
$linklist = '';
foreach ($res as $key=>$value){
$doc=$modx->getDocument($key);
if($doc['type']=='reference'){
if ($linklist != '') $linklist .= ',';
$linklist .= $doc['id'];
}
}
return $result;
?>
It just outputs a comma-separated list of all the weblinks under the $container doc, up to the $depth depth. As you can see, no need to set the description of the links to ’weblink’ - there’s already a field (type=reference) for that on the modx_site_content table.
The actual output of the weblinks on your pages can be done in many ways, i guess you can pick up from this.For instance using Ditto 2:
[tt][[Ditto?documents=`[!WebLinksList?container=`21`!]` &tpl=`ExternalLinks`]][/tt]
Styling the list on the ExternalLinks chunk.