XF 2.1 RM (Resource Manager) modification help

JohnLogar

Active member
Hi,
Is there any good way to split comma separated value of a custom field in the next line.
For example in attachment there are two names in Credit Name with comma seprated i wants to split Russel in next line and same for Reason of credit
1595062584164.webp

Any help is really apprcited.

Thanks
 

Not possible without custom development I believe.
 
I had a fix, but it breaks custom fields in add ons using the same XF function which was necessary to run on my forum (AMS & RMS, no fault of Bob for using XF functions).

I ditched it for now until I can find a workaround that keeps add on functionality while separating by a space (for different formatting) elsewhere in XF.
 
Thanks, @frm for your reply.

I got the desired functionality by extending the default Definition class.

There is a function getFormattedValue in Definition class which renders the custom field value.
I checked that if the custom field is my specific custom field then code should work.

public function getFormattedValue($value) { if($this->field['field_id']=='any_specific_id' && strpos($value, ',') !== false ){ $output = str_replace(',', '<br />', $value); return $output; } return parent::getFormattedValue($value); }

Please let me know if I'm doing something wrong here.

Thanks
 
Please let me know if I'm doing something wrong here.
I didn't think about setting it up like that with the specific field id in an if statement. Looks like I can move forward with setting up my forum with that now as without that, it has undesirable effects on other inputs.
 
Back
Top Bottom