[OJS 3.3.0-8] How to display download file count in Table Of Contents

Description of issue or problem I’m having:
Hello, I’ve tried to display the DOI, Abstract views count and Download count in Table of contents(OJS 3.3.0-8).
Both DOI and abstract views count were displayed correctly, But the Download count doesn’t display anything, see image below.
Screen Shot 2021-11-16 at 07.15.50
I want the file download count displayed on red box.

Steps I took leading up to the issue:
I followed the guide from this thread:

the video link on the thread is written on this webpage:
From the tutorial above, the download file count seems to only work in OJS 3.1.

This is the code i’ve tried on this case:
file: templates/frontend/objects/article_summary.tpl

{*Show abstract views count: it works*}
{translate key="article.abstract"} views: {$article->getViews()} , 

{*show file download count: it doesn't works*}
{if is_a($article, 'ArticleGalley')}{assign var=galleys value=$article->getGalleys()}
{if $galleys}
	{foreach from=$galleys item=galley name=galleyList}
		{$galley->getGalleyLabel()} Downloaded = {$galley->getViews()} times

I hope there is a solution for my problem. Thank you.

I use the following code for get article and PDF view count:
It works in OJS

{assign var=galleys value=$article->getGalleys()}
Görüntüleme: {$article->getViews()}
{if $galleys}
    {foreach from=$galleys item=galley name=galleyList}
       / İndirme: {$galley->getViews()}
1 Like

Hi @kerimsarigul , I’m so sorry for my late response and thank you for your answer, your code works like charm on OJS It also works on version. I really appreciate that. :grinning:

1 Like