How to combine 2 fields as title_name in a relationship field type?

cherisho - 1 month ago

Hi everyone! I have the following to declare a relationship field: 'patient' => [ 'type' => 'anomaly.field_type.relationship', 'config' => [ 'mode' => 'search', 'key_name' => 'id', 'title_name' => 'last_name', 'related' => \Vendor\PatientsModule\Patient\PatientModel::class, ], ],

It renders perfectly in the form. The fields for the Patient stream are: first_name, last_name, email, etc.

But how can I display the first_name and last_name fields together, as the title_name in the field definition above?

ryanthompson - 1 month ago

Without a custom options handler there's no way to do this. But.. it does give me an idea to use the Value utility to map options similar to table columns. That would make this kinda thing much easier!

cherisho - 1 month ago

Thanks for pointing me in the right direction!