Ok Guys, thanks for your help. I managed to create a snippet with the following in, which worked for me. let me explain what I did:
Created a TV called GetFacilities, input as checkbox, output as delimiter using value ,
When calling the GetFacilities snippet ensured the opening and closing ul tags are around the snippet.
My snippet code is:
$output = '';
$tv = $modx->getObject('modTemplateVar',array('name'=>"Facilities"));
// retreives the full array key->value of the TV
$options = explode('||',$tv->get('elements'));
$id = $modx->resource->get('id');
$page = $modx->getObject('modResource', $id);
$tv = $page->getTVValue('Facilities');
// outputs into an array only the keys (checkboxes that are selected only against that document)
$tvarray = explode(',', $tv);
// loops through the array which only contains each of our selected checkboxes
foreach($tvarray AS $option) {
// loops and checks if the key against the full list in $otions exists, if it does exist, appends to $output
if(isset($options[$option])) {
$value = $options[$option];
$output .= "<li>".$value."</li>";
}
}
// the end result, only showing values of the checkbox that has been selected against that document
return $output;
Hopefully this should help somebody else out an it took me awhile to understand it.