Tag Cloud plugins OJS 3.0

There is some date to install Tag Cloud plugins in OJS 3.0. It turns out that we need to be able to visualize in the content the keywords together with the summaries of each article.

We can add them to the content but it would be much more efficient this plugins.

Hi @Leonardo_Letelier,

We don’t have anything concrete planned for this yet, unfortunately.

Regards,
Alec Smecher
Public Knowledge Project Team

Thanks for the reply, @asmecher

In the article_details.tpl file there is a comment where it indicates that there is missing script referring to the keywords.

There is some simple script that only shows the keyword below the abstract that can be easily inserted into the article_details.tpl file.

I’m newbie and this is super needed, do not think this would not be in version 3.0.

Hi @Leonardo_Letelier

See also this issue and a long discussion on this topic there: Issues with input and display of keywords · Issue #1828 · pkp/pkp-lib · GitHub – at some point in the future we will display the keywords…
I do not understand totally what do you mean :-\ – would it be enough for you to just display the keywords on the article page? If so I can eventually help i.e. point you how to change the code for that. The Tag Cloud function would be not so easy to implement.

Best
Bozana

1 Like

Thanks for your reply. @bozana.

If indeed I just want a simple script that can display the keywords for now.

Print the keywords together with the item detail.

That solution serves me well.

1 Like

Hi @Leonardo_Letelier

Instead of “{* @todo keywords not yet implemented *}” in tempaltes/frontend/objects/article_details.tpl you would need something like:

<div class="keywords">
<h3 class="label">
{translate key="article.subject"}
</h3>
{foreach from=$keywords item=keyword}
{foreach from=$keyword item=keywordItem}
<div class="value">
{$keywordItem|escape}
</div>
{/foreach}
{/foreach}

Best,
Bozana

1 Like

Thank you, @bozana

The script works perfectly, I already integrate it.

Thanks, but two things:

  1. What about using KEYWORDS block after ABSTRACT block?

  2. How is it possible to display keywords like this “keyword1, keyword2, keyword3, keyword4” instead of:
    keyword1
    keyword2
    keyword3
    keyword4

@rkhalikov

You would then insert this code at this line ojs/article_details.tpl at ojs-3_0_2-0 · pkp/ojs · GitHub

<div class="item keywords">
<h3 class="label">
{translate key="article.subject"}
</h3>
<p>
{foreach from=$keywords item=keyword}
{foreach name=keywords from=$keyword item=keywordItem}
{$keywordItem|escape}{if !$smarty.foreach.keywords.last}, {/if}
{/foreach}
{/foreach}
</p>
</div>

Best,
Bozana

1 Like

Magically! :wink:

Thanks a lot! Will this functionality be implemented in OJS 3.1?

One more little thing. Is it possible to ignore KEYWORDS block in case of keywords absence in the article?

Guess I need to use something like {if $article->getLocalizedĐĄĐĄĐĄĐĄĐĄ()} but what exactly?

Hi @rkhalikov

I think this would then helps:

{if !empty($keywords[0])} 
<div class="item keywords">
<h3 class="label">
{translate key="article.subject"}
</h3>
<p>
{foreach from=$keywords item=keyword}
{foreach name=keywords from=$keyword item=keywordItem}
{$keywordItem|escape}{if !$smarty.foreach.keywords.last}, {/if}
{/foreach}
{/foreach}
</p>
</div>
{/if} 

I.e. the {if…}…{/if} around that code…

Best,
Bozana

No, such kind of IF removes KEYWORDS block completely… :frowning: Even for articles with keywords metadata.

Hmmm… Then maybe this:
{if !empty($keywords[$currentLocale])}
i.e. $currentLocale instead of 0.

Sorry…
Bozana

1 Like

Yes! Thanks! Now everything is OK.