Custom field Joomla article on addon articles_scroller - Forum | JoomShaper
Awaiting an answer SP Page Builder

Custom field Joomla article on addon articles_scroller

Asked by Easy Connect 83 3 years ago Last activity 3 years ago

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

2 replies

Toufiq Senior Staff

Hi there,

I appreciate you reaching out. Do you want to apply the custom field inside the addon? If yes, this feature is not ready.

-Thanks

Easy Connect 83 Asked this

Yes that's right. I know it's not officially possible yet, however, can you give me a procedure to follow by taking inspiration from the addon articles.
Thanks

Log in to reply.