Jump to content

Displaying Custom Field Information


Daniel B

Recommended Posts

I'm trying to figure out how to add custom client field information into templates.

 

I would like to display specific fields (so I'd need to use the ID of the field instead of displaying them all), and I would like to display the name, and value of the field.

 

Simply just trying to add something like this to the admin_clients_view.pdt

 

Client Custom Field Name

Client Custom Field Value

Link to comment
Share on other sites

i don't know well what you want , but from what i have understand you can't get them in the admin_client_view . as all the custom_field are sent to the admin_clients_custom_fields.pdt .

 

 

you need to change the admin_client.php in the app/controller folder and make it add the custom field to the view() function , so go to line 177  (// Set all contact types besides 'primary' and 'other')

 

 

add before it


// Set client custom field values
   $field_values = $this->Clients->getCustomFieldValues($client->id);
   foreach ($field_values as $field) {
    $client->{$this->custom_field_prefix . $field->id} = $field->value;
   }

then in the admin_client_view you can show it with this

$client->custom_fieldYOURFIELDID

change YOURFIELDID with the field_id already set in settings

 

the fila code shoulde be

Custom Field ID : <?php $this->Html->_($client->custom_fieldYOURFIELDID);?>

i hope this can help

 

best regards

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...