I have a Department page. I create several Department pages (Dept A, Dept B Dept C)
I have a Jobs DataObject with a field "ASIA" that has a CheckboxsetField that displays the Departments Page Titles you can select from.
$Rolesob = DataObject::get('Department');
$Rolesob = $Rolesob->toDropDownMap('Title', 'Title');
$fields->addFieldToTab('Root.ASIA', new CheckboxsetField('ASIA', 'ASIA (create Department Page first)', $Rolesob));
When I display the $ASIA on the template I get "Dept A, Dept B" as 1long string. Searching through the forum I found someone had a similar issue and the answer was that the result needed to be exploded with a function:
//Get Explode Title from $ASIA
function ExplodedTopics()
{
$set = new DataObjectSet();
if($ASIA = $this->ASIA) {
foreach(explode(',',$ASIA) as $key => $Title) {
$set->push(new ArrayData(array('Title' => $Title)));
}
}
return $set;
}
This function explodes the results perfectly. I place this in my template and I get the results I need.
<% control ExplodedTopics %>
<p>$Title</P>
<% end_control %>
My problem is this. The titles that are being displayed come from a Department page. How do I make them links back to their pages?
Thanks,
Brian