fesp
April 25, 2017, 1:04pm
1
Currently, the journal homepage shows the current issue. After reading this forum, I found it will require modification of the code to show more recent issues. I am using Open Journal Systems 2.4.8.0. Please suggest what code I should add. Thank you.
1 Like
Currently the index handler select the current issue for display here:
$displayCurrentIssue = $journal->getSetting('displayCurrentIssue');
$issueDao =& DAORegistry::getDAO('IssueDAO');
$issue =& $issueDao->getCurrentIssue($journal->getId(), true);
if ($displayCurrentIssue && isset($issue)) {
import('pages.issue.IssueHandler');
// The current issue TOC/cover page should be displayed below the custom home page.
IssueHandler::_setupIssueTemplate($request, $issue);
}
$enableAnnouncements = $journal->getSetting('enableAnnouncements');
if ($enableAnnouncements) {
$enableAnnouncementsHomepage = $journal->getSetting('enableAnnouncementsHomepage');
if ($enableAnnouncementsHomepage) {
$numAnnouncementsHomepage = $journal->getSetting('numAnnouncementsHomepage');
$announcementDao =& DAORegistry::getDAO('AnnouncementDAO');
$announcements =& $announcementDao->getNumAnnouncementsNotExpiredByAssocId(ASSOC_TYPE_JOURNAL, $journal->getId(), $numAnnouncementsHomepage);
$templateMgr->assign('announcements', $announcements);
$templateMgr->assign('enableAnnouncementsHomepage', $enableAnnouncementsHomepage);
}
}
$templateMgr->display('index/journal.tpl');
It is passed off to the template index/journal.tpl, which displays the issue’s detail with this call:
Which brings in the issue template:
{**
* templates/issue/view.tpl
*
* Copyright (c) 2013-2016 Simon Fraser University Library
* Copyright (c) 2003-2016 John Willinsky
* Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
*
* View issue -- This displays the issue TOC or title page, as appropriate,
* *without* header or footer HTML (see viewPage.tpl)
*}
{if $subscriptionRequired && $showGalleyLinks && $showToc}
<div id="accessKey">
<img src="{$baseUrl}/lib/pkp/templates/images/icons/fulltext_open_medium.gif" alt="{translate key="article.accessLogoOpen.altText"}" />
{translate key="reader.openAccess"}
<img src="{$baseUrl}/lib/pkp/templates/images/icons/fulltext_restricted_medium.gif" alt="{translate key="article.accessLogoRestricted.altText"}" />
{if $purchaseArticleEnabled}
{translate key="reader.subscriptionOrFeeAccess"}
{else}
{translate key="reader.subscriptionAccess"}
{/if}
This file has been truncated. show original
To make this display more than one issue, you would need to iterate over the issues, similar to the way that the site homepage would iterate over the journals:
The journals iterator is constructed here:
$journals =& $journalDao->getJournals(
true,
$rangeInfo,
$searchInitial?JOURNAL_FIELD_TITLE:JOURNAL_FIELD_SEQUENCE,
$searchInitial?JOURNAL_FIELD_TITLE:null,
$searchInitial?'startsWith':null,
$searchInitial
);
$templateMgr->assign_by_ref('journals', $journals);
This solution may relate to these prior questions:
Hi @Tiziano
The system gives you the option to display only the current issue. If you need something else, you would have to enter it manually in the home page input field, e.g. “Additional Content” in Setup 5.2 Journal Homepage Content.
Best,
Bozana
Hello all,
Wondering if a journal can change from an issue based publication to a publish-as-you-go, article based publication?
Best,
1 Like