Development of custom field type

11 years 1 month ago #223115 by obm
Hi,

I'm currently developing a comprofiler plugin in addition to a native joomla component. I basically need a custom field type to show in the user profile. It also needs to be searchable in the user list.

The field value is not editable, but depends on some other profile fields and information from the joomla component.

After reviewing some existing plugins, I tried to extend the cbFieldHandler class:
$_PLUGINS->registerUserFieldTypes(array('myfield' => 'CBfield_myfield'));

class CBfield_myfield extends cbFieldHandler {

	function getField( &$field, &$user, $output, $reason, $list_compare_types ) {
		return "MyField";
	}
}

Additionally, I added a fieldtypes section to the plugin manifest:
<fieldtypes>
	<field type="myfield" label="A custom field"></field>
</fieldtypes>

Unfortunately the new field doesn't show up in comprofiler backend and can't be added to any tab. Does anyone know what's missing?

Regards
obm

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.147 seconds

Facebook Twitter LinkedIn