Hi
I guess you could accomplish this easily by using a textarea TV and a Snippet
The user may enter list items in the textarea, one item per line for example.
To convert this text to a list, you have to programm a simple snippet. To make this reusable you just pass the name of the TV to the snippet.
Lets assume your TV is named "ListItems" and your Snippet will be named "TextToList", then you create a html list by calling
[[TextToList?tv=`ListItems`]]
The snippet will convert the list Items to HTML and ouput it.
Cheers -- roman
EDIT:
Here is a snippet you could use:
<?php
/**
* Convert a text with linebreaks to a html list
*/
$chunk = isset($chunk) ? $chunk : false;
$tv = isset($tv) ? $tv : false;
$delimiter = isset($delimiter) ? $delimiter : "\n";
if($tv){
$tvArray = $modx->getTemplateVarOutput(array($tv), $modx->documentObject['id']);
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;
?>
Copy it into a snippet called "TextToList", then call it by either specifying a template Variable or a Chunk name
eg. [[TextToList?tv=`TVNAME`]]
or: [[TextToList?chunk=`CHUNKNAME`]]