Hello,
Can you tell me how to insert a custom field of a Joomla article in the articles list of the articles_scroller addon via the site.php view?
I saw this instruction in the site.php file of the addon articles but it does not work I have this error: trim(): Argument #1 ($string) must be of type string, array given
with this code for Joomla 4:
JLoader::registerAlias('FieldsHelper', 'Joomla\Component\Fields\Administrator\Helper\FieldsHelper');
$custom_fields = FieldsHelper::getFields('com_content.article',$item);
$output .= FieldsHelper::render(
'com_content.article',
'fields.render',
array(
'context' => 'com_content.article',
'item' => $item,
'fields' => $custom_fields,
)
);
Thanks