Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$primaryGenreIds is empty #39

Open
klausru opened this issue Feb 27, 2024 · 1 comment
Open

$primaryGenreIds is empty #39

klausru opened this issue Feb 27, 2024 · 1 comment

Comments

@klausru
Copy link
Contributor

klausru commented Feb 27, 2024

Dear all

I just figured that $primaryGenreIds is empty in

{include file="frontend/objects/article_summary.tpl" section=null showDatePublished=true hideGalleys=true}

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
Copy link
Collaborator

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:

{foreach from=$group.articles item=article}

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().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants