User Tools

Site Tools


tips:display-custom-field-value

Displaying custom field values in any page

This is really simple by calling a single function passing the custom field ID, project or user ID and the type.

How to use this function?

To show a custom field value for project, simply add two lines of code.

<?php 
$fields = JblanceHelper::get('helper.fields');
echo $fields->getFieldValue(12, $row->id, 'project');
?>

In the above code, line 1 creates and instance of the class and should not be changed.

In the line 2, first parameter is the custom field ID, second parameter is the project ID and thrid parameter is the type. For projects, type is 'project'

To show a custom field value for profile, simply add two lines of code.

<?php 
$fields = JblanceHelper::get('helper.fields');
echo $fields->getFieldValue(3, $row->id, 'profile');
?>

In the above code, line 1 creates and instance of the class and should not be changed.

In the line 2, first parameter is the custom field ID, second parameter is the User ID and third parameter is the type. For profiles, type is 'profile'

tips/display-custom-field-value.txt · Last modified: 2015/04/10 11:31 (external edit)