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 Quote
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 ? Quote
Daniel B Posted August 30, 2014 Author Report Posted August 30, 2014 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 Quote
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 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.