For the exampel above i didn't use community builder. This as i don't want to subscribe for it.
So i tried the custom fields and then in particularly the fields that can be added to users.
- A field type was added as List and then the values were added
- withen the user-profile the value was selected
- the some code in jemhelper and attendees table to display the value
Attendees-view
/views/attendees/tmpl/default.php (backend)
<th><?php echo 'Vocal'?></th> // better to use a text string
...........
<td><?php echo JemHelper::getAttendeeVocal($row->uid); ?></td>
As you see it will call the jem helper
JEM Helper
components/com_jem/helpers/helper.php (frontend)
static public function getAttendeeVocal($userId)
{
if (empty($userId)) {
return false;
} else {
JLoader::register('FieldsHelper', JPATH_ADMINISTRATOR . '/components/com_fields/helpers/fields.php');
$currentUserFields = FieldsHelper::getFields('com_users.user', null , true);
$vocalField = array();
$fieldId = null;
foreach ($currentUserFields AS $field) {
if ($fieldName = "vocals") {
$vocalField[] = $field->id;
$fieldId = $field->id;
}
}
$model = JModelLegacy::getInstance('Field', 'FieldsModel', array('ignore_request' => true));
$vocalValue = $model->getFieldValues($vocalField,$userId);
$vocalValue = implode(', ', $vocalValue);
return $vocalValue;
}
}
As you see in the code it's checking for a specifc fieldttype "vocal". Ofcourse you can name it to anything you want.
This solution is maybe a bit tricky and maybe a bit need to change. it's not using data by CB but well it's a solution.
Not sure if all users in comprofiler are stored in Joomla users table?. If you have a lot users i guess it might be a problem to fill in the value for every user but well.
Will take a further look in the weekend.