look at the view.html.php in views/hotspot/
there I do this:
$customFieldsModel = JModelLegacy::getInstance('Customfields', 'HotspotsModel');
$customFields = $customFieldsModel->getItems($hotspot->catid);
// Make a new array that has the slug for key
foreach ($customFields as $field)
{
$this->customFields[$field->slug] = $field;
}
I load the config for the custom field for this category.
Then in the actually template I go through each custom field and if we have an entry, then I display it.
<?php if($this->hotspot->customfields && $this->customFields) : ?>
<div class="hotspots-customfields">
<h6><?php echo JText::_('COM_HOTSPOTS_CUSTOM_FIELDS'); ?></h6>
<?php foreach($this->hotspot->customfields as $key => $customFields): ?>
<?php if(isset($this->customFields[$key])) : ?>
<dl class="dl-horizontal">
<dt><?php echo JText::_($this->customFields[$key]->title); ?></dt>
<dd><?php echo HotspotsHelperCustomfields::getTranslatedValue($this->customFields[$key], $customFields); ?></dd>
</dl>
<?php endif; ?>
<?php endforeach; ?>
</div>
<?php endif; ?>
Btw, I'm currently working on refactoring the whole code and moving it to our library (this way we will be able to add custom fields to all our components). So with the next update you'll have to do some changes to your code. Just letting you know, so that you don't wonder when you update
Cheers,
Daniel