pkp / browseBySection

This OJS 3 plugin adds support for browsing published articles by section.
GNU General Public License v2.0
2 stars 14 forks source link

$primaryGenreIds is empty #39

Open klausru opened 6 months ago

klausru commented 6 months ago

Dear all

I just figured that $primaryGenreIds is empty in https://github.com/pkp/browseBySection/blob/e64a9afb3230dd7f2a992f1535bf89e51728a079/templates/frontend/pages/section.tpl#L44

In my article_summary.tpl I wanted to only show galley links for $primaryGenreIds and no galley links for supplementary material. This works fine in issues but not via the section.tpl How could that be solved as $article isn't present as in article_summary.tpl

ctgraham commented 6 months ago

I'm not following your statement, "$article isn't present as in article_summary.tpl", as article_summary.tpl does expect the $article variable:

https://github.com/pkp/ojs/blob/8d31babfa19c0b27ae35d46a24014dbeb8e4f77d/templates/frontend/objects/article_summary.tpl#L10

and we are setting the $article variable in the foreach: https://github.com/pkp/browseBySection/blob/e64a9afb3230dd7f2a992f1535bf89e51728a079/templates/frontend/pages/section.tpl#L41

So I may be misunderstanding the bigger picture, but I do concur that article_summary.tpl does also expect $primaryGenreIds: https://github.com/pkp/ojs/blob/8d31babfa19c0b27ae35d46a24014dbeb8e4f77d/templates/frontend/objects/article_summary.tpl#L16 And we are not setting them in this template.

The method for setting them can be found here: https://github.com/pkp/ojs/blob/9adc8ef421976d62714584e2860cf2d87f783a0b/pages/article/ArticleHandler.php#L263-L267

We would need to add this into BrowseBySectionHandler::view().