How to bring to the mainpage only the last issue, starting with articles, with plugin Oldgregg

  • Hello @Vitaliy thanks for your time:

  • We work with OJS 3.2.1.2

We work in 3 journals and these are using oldgregg theme, we now that oldgregg bring the best_id, and can bring diferents issues in the Homepage, i explained but they insist to bring only the last issue and display first the articles and before other section. I don’t now if i have to do some configuration in this file OldGreggThemePlugin.inc.php or in this route oldGregg/templates/frontend/pages/indexJournal.tpl i see on code $latestArticles and $latestIssues i move some things but I have not succeeded. I don’t now if $latestArticles bring the last articles with the last issue or bring the latest move, may be in other issue and $latestArticle display article of other issue.

Thanks, :smiley:

2 Likes

Hi @Daniel_delagarza,

The part where the latest articles are retrieved is here: oldGregg/OldGreggThemePlugin.inc.php at 05db1148519c61d8a838a934b4a74082189493c4 · Vitaliy-1/oldGregg · GitHub
This would require modifications in order to show publications only from the latest issue. Are you handy with PHP?

2 Likes

Thanks for your prompt response @Vitaliy :smiley:
i see:
$publishedArticleObjects = Services::get(“submission”)->getMany([
‘status’ => STATUS_PUBLISHED,
‘contextId’ => $journalId,
‘count’ => $latestArticles,
‘orderBy’ => ‘datePublished’,
]);
I more o less handy with PHP, i try with lots of energy, i have permission to write on code. I think that in all keys, have to bring different thinks, maybe in ‘count’ => $current_issue and in ‘orderBy’ maybe it moves in array $current_issue and don’t be neccesary delete. Status and contextId i don’t have idea what are they doing. I have to only move things on the file OldGreggThemePlugin.inc.php?

Thanks, we write from México. :smiley:

journal index page already has variable $publishedSubmissions, it’s an array of articles published in the latest issue grouped by sections. It’s possible to retrieve the variable from the template manager (Smarty): immersion/ImmersionThemePlugin.inc.php at ade38b2302b4f94b7200ff2539ba699be09f28b6 · pkp/immersion · GitHub, manage the data how you need and assign it back to Smarty.

The best would be to create a child theme of the Old Gregg theme and do this manipulation there with overriding indexJournal page in the way that is needed: Child Themes

1 Like

Hello @Vitaliy:
We try this:

$issue =“number_of_issue”

$publishedArticleObjects = Services::get(“submission”)->getMany([
‘status’ => STATUS_PUBLISHED,
‘contextId’ => $journalId,
‘count’ => $latestArticles,
‘issueIds’ => $issue
]);
We bring the last number, but is temporally, because we bring the last issue, but when the journal published a new issue,we have to change in code the number_of_issue, i search in some indexJournal, and i didn’t find $publishedSubmissions, Im studying and trying to undertand the code, smarty, the keys etc. Thanks for the information, any other information is going to be very important, i see that immersion it serves to a child, but i continue studying :slight_smile: @Vitaliy thanks!
Regards!

E.g.:

$issueDao = DAORegistry::getDAO('IssueDAO');
$currentIssue = $issueDao->getCurrent('journalId');
...
'issueIds' => $currentIssue->getId();
...
2 Likes