Articles Field

How can i render articles fields in newsflash module or other articles module?

1 year 4 months ago #83677

Octav A's Avatar Octav A

Hello,
Please advise is it possible to render articles fields in newsflash module (joomla standard)? Fields are inserted as {field id} in intro and fulltext but they are not rendered in module when module set to show intro.

1 year 4 months ago #83684

Peter van Westen's Avatar Peter van Westen Admin

You can use Articles Anywhere Pro to place custom fields (and any other article data) anywhere you want. So also inside modules.
The free version of Articles Anywhere doesn't support custom fields.

www.regularlabs.com/extensions/articlesanywhere

1 year 4 months ago #83697

Octav A's Avatar Octav A

Thanks for quick reply and offer. Also please advise how to limit displayed linked articles. 100 linked articles is required to link and to display: 5 or 10
This is really important

1 year 4 months ago #83701

Peter van Westen's Avatar Peter van Westen Admin

I am not sure what you mean by:

100 linked articles is required to link and to display: 5 or 10
Can you elaborate on what setup you are going for and how you see this working.

1 year 4 months ago #83710

Octav A's Avatar Octav A

Hi,

I have 100 articles and use one articles field (field 1) to link to other articles. I link each articles (from 100) to 1 same article (which is their parent). Now when i insert {field 1} on each articles will get the parent article data. On the parent article page i want to display first 10 articles from those 100 linked (not all 100).
How to do this?

1 year 4 months ago #83712

Peter van Westen's Avatar Peter van Westen Admin

You could create a template override for file:

plugins/fields/articles/layouts/plg_fields_articles/linked_articles.php
Copy that to:
templates/[YOUR TEMPLATE]/html/layouts/plg_fields_articles/linked_articles.php

Then under line:
$ids = PlgFieldsArticlesHelper::getLinkedArticleIds($custom_fields, $item->id, $field);
You can add:
$ids = array_slice($ids, 0, 10);

1 year 4 months ago #83713

Peter van Westen's Avatar Peter van Westen Admin

Or create a custom layout under:

templates/[YOUR TEMPLATE]/html/layouts/com_fields/field
And then select that custom layout in Field settings (under Options > Render Options).

1 year 4 months ago #83722

Peter van Westen's Avatar Peter van Westen Admin

1 year 4 months ago #83725

Octav A's Avatar Octav A

I have created and modified templates/[YOUR TEMPLATE]/html/layouts/com_fields/field as you have advised.
I am using field type: Show linked articles
When selecting new field layout in backend, the field does not display but get this error: 0 Call to a member function render() on null
With default layout field works and displays all articles.
Please let's sort this out

1 year 4 months ago #83727

Peter van Westen's Avatar Peter van Westen Admin

The format/content of the file in:

templates/[YOUR TEMPLATE]/html/layouts/com_fields/field
is NOT the same as a plugin layout override in:
templates/[YOUR TEMPLATE]/html/layouts/plg_fields_articles/linked_articles.php

Please read the Joomla documentation on how layouts should be created and formatted.

There are some examples of field layout overrides in the Articles Anywhere documentation too:
www.regularlabs.com/extensions/articlesa...a-tags-custom-fields