Search
Other Articles Field questions
Forum

Count number of article field values per article

Octav A's Avatar Octav A
Hello,
Please help how to display count of Articles linked per per article?
Thanks
Peter van Westen's Avatar Peter van Westen ADMIN
You would have to do this with a custom layout, which you can create and then select in the Options tab of the custom field.
Then you can do a count on the fields rawvalue (array of article ids).
Please post a rating at the Joomla! Extensions Directory
Octav A's Avatar Octav A
😁 I figured out that this is the solution but hoped that some magic may be as it is in other cases with your fields and articles. Thanks
Octav A's Avatar Octav A
Actually there is some magic. For anyone who may need this. - the simplest solution was to display the count not by custom field but like this:
{articles id="this:custom_field" limit="1"}[total_no_limit]{/articles}
Which gives me the output i need.
However i dont know about performance. Would it be faster loading to use a custom_field override for counting linked articles?
Peter van Westen's Avatar Peter van Westen ADMIN
Yep, you can do this with Articles Anywhere 🙂

Loading via direct php will probably be marginally faster, as then you only do what is absolutely necessary.
Using a plugin tag requires Joomla to pass the content to the plugin, the plugin to search for it and replace it, etc.

But unless you have some loop causing this tag to be placed many many times on one page, the effect will be negligible.
Especially with caching in play.
Please post a rating at the Joomla! Extensions Directory
Octav A's Avatar Octav A
Got it, thanks!
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription