Accessing issue data from article template

Hi!

I am developing a theme for an OJS installation (3.3.0-6) with several journals in it. I am trying to write a template for search results containing articles from several journals.

I am overriding article-summary.tpl for this purpose.

In this template I am trying to access some data from both the journal and the issue containing the article.
Accessing the journal data was simple, like $journal->getLocalizedName(). I am however having trouble accessing the issue data. $issue doesn’t seem to be defined in this context.

How can I get hold of that in this context? I am looking for methods like getNumber(), getVolume() etc.

Answering this myself:

In search.tpl, where article-summary.tpl is included, we need to add issue=$result.issue to the variable list.

So this line:
{include file="frontend/objects/article_summary.tpl" article=$result.publishedSubmission journal=$result.journal showDatePublished=true hideGalleys=true heading="h3"}

Becomes this line:
{include file="frontend/objects/article_summary.tpl" issue=$result.issue article=$result.publishedSubmission journal=$result.journal showDatePublished=true hideGalleys=true heading="h3"}

1 Like