Daniel B Posted August 29, 2014 Report Posted August 29, 2014 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
Blesta Addons Posted August 29, 2014 Report Posted August 29, 2014 in wich view you need to display this field ? wich template you are trying to work with it ?
Daniel B Posted August 30, 2014 Author Report Posted August 30, 2014 On 8/29/2014 at 9:21 PM, naja7host said: in wich view you need to display this field ? wich template you are trying to work with it ? I posted it in my first post: admin_clients_view.pdt
Blesta Addons Posted August 30, 2014 Report Posted August 30, 2014 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
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now