Right now I’m doing this with a custom snippet. I created a TV (textarea) where the client can manually edit the links. The only requirement is that the links be separated by a hard return. Here’s the snippet, call it [!ListBuilder!]
<?php
/**
* Convert a text with linebreaks to a html list
* written by Roman
*/
$chunk = isset($chunk) ? $chunk : false;
$tv = isset($tv) ? $tv : false;
$delimiter = isset($delimiter) ? $delimiter : "\n";
$docid = isset($docid) ? $docid : $modx->documentObject['id'];
if($tv){
$tvArray = $modx->getTemplateVarOutput(array($tv), $docid);
if(!$tvArray[$tv])
return;
$text = $tvArray[$tv];
} else if($chunk){
$text = $modx->getChunk($chunk);
if(!$text)
return;
} else {
return;
}
$lines = explode($delimiter, $text);
$out = '<ul>';
foreach($lines as $line){
$out .= '<li>' . trim($line) . '</li>';
}
$out .= '</ul>';
return $out;
?>
This snippet calls on the text area tv where the links are built manually and separated by line breaks.
<a href="/sample.html#sample1">Sample 1</a>
<a href="/sample.html#sample2">Sample 2</a>
<a href="/sample.html#sample3">Sample 3</a>
I think this could work for you.