[OJS 3] Archives -- Group by Year

I have done that in OJS 3.1.0.1
https://eap-iea.org/index.php/eap/issue/archive
Please check image how my code looks like.
Screenshot_2018-09-07_12-18-02
you can delete once lines related to fronted/object/issue_summary.tpl since I put them twice.

Hi,

The code above works in OJS 3.1.1.2 as well.

Here is the modified templates/frontend/pages/issueArchive.tpl file. Replace the content of that file with the code below. If nothing happens, then you are probably using a theme that has it’s own issueArchive.tpl template so you have to add the changes to that file instead.

{**
 * templates/frontend/pages/issueArchive.tpl
 *
 * Copyright (c) 2014-2018 Simon Fraser University
 * Copyright (c) 2003-2018 John Willinsky
 * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
 *
 * @brief Display a list of recent issues.
 *
 * @uses $issues Array Collection of issues to display
 * @uses $prevPage int The previous page number
 * @uses $nextPage int The next page number
 * @uses $showingStart int The number of the first item on this page
 * @uses $showingEnd int The number of the last item on this page
 * @uses $total int Count of all published monographs
 *}
{capture assign="pageTitle"}
	{if $prevPage}
		{translate key="archive.archivesPageNumber" pageNumber=$prevPage+1}
	{else}
		{translate key="archive.archives"}
	{/if}
{/capture}
{include file="frontend/components/header.tpl" pageTitleTranslated=$pageTitle}

<div class="page page_issue_archive">
	{include file="frontend/components/breadcrumbs.tpl" currentTitle=$pageTitle}

	{* No issues have been published *}
	{if empty($issues)}
		<p>{translate key="current.noCurrentIssueDesc"}</p>

	{* List issues *}
	{else}

	  <ul class="issues_archive">
	  	{foreach from=$issues item="issue"}
	  		{if $issue->getYear() != $lastYear}
	  			<li><h3>{$issue->getYear()|escape}</h3></li>
	  			{assign var=lastYear value=$issue->getYear()}
	  		{/if}
	  		<li>
	  			{include file="frontend/objects/issue_summary.tpl"}
	  		</li>
	  	{/foreach}
	  </ul>

		{* Pagination *}
		{if $prevPage > 1}
			{url|assign:"prevUrl" router=$smarty.const.ROUTE_PAGE page="issue" op="archive" path=$prevPage}
		{elseif $prevPage === 1}
			{url|assign:"prevUrl" router=$smarty.const.ROUTE_PAGE page="issue" op="archive"}
		{/if}
		{if $nextPage}
			{url|assign:"nextUrl" router=$smarty.const.ROUTE_PAGE page="issue" op="archive" path=$nextPage}
		{/if}
		{include
			file="frontend/components/pagination.tpl"
			prevUrl=$prevUrl
			nextUrl=$nextUrl
			showingStart=$showingStart
			showingEnd=$showingEnd
			total=$total
		}
	{/if}
</div>

{include file="frontend/components/footer.tpl"}
4 Likes

Yes. That is it. The code works. Thank you a lot.

It’s possible to create an overview about all Volumes. I would like to have a smal menu, that the user can selected between the different volumes. For example:

2015 | 2016 | 2017 | 2018 | 2019

Because we have 50 volumes with more than 200 issues and in the actual archiv, it is very difficult to find a singel issue.

I made Journal archive toggle. Maybe someone can use it.

2 Likes

It’s really interesting, thanks!
Would you be so kind to make a plugin out of it?

1 Like

I’m sorry. I don’t think i have enough expirience.

Hi, is it possible to add accordion syle in it? I tried doing it but it only showed one issue from the year (as it has foreach code).

that would require javascript of some sort probably.

https://jqueryui.com/accordion/

I think jqueryui is loaded by default in OJS, not sure of frontend though.

Hi, guys!

I have this code:

{**

  • templates/frontend/pages/issueArchive.tpl
  • Copyright (c) 2014-2018 Simon Fraser University
  • Copyright (c) 2003-2018 John Willinsky
  • Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
  • @brief Display a list of recent issues.
  • @uses $issues Array Collection of issues to display
  • @uses $prevPage int The previous page number
  • @uses $nextPage int The next page number
  • @uses $showingStart int The number of the first item on this page
  • @uses $showingEnd int The number of the last item on this page
  • @uses $total int Count of all published monographs
    *}
    {capture assign=“pageTitle”}
    {if $prevPage}
    {translate key=“archive.archivesPageNumber” pageNumber=$prevPage+1}
    {else}
    {translate key=“archive.archives”}
    {/if}
    {/capture}
    {include file=“frontend/components/header.tpl” pageTitleTranslated=$pageTitle}
<div class="page-header page-archives-header">
	<h1>{$pageTitle}</h1>
</div>

{* No issues have been published *}
{if empty($issues)}
	<div class="row">
		<div class="col-md-8">
			<p>{translate key="current.noCurrentIssueDesc"}</p>
		</div>
	</div>

{* List issues *}
{else}
	{foreach from=$issues item="issue" key="i"}
		{if $i % 4 == 0 && $i > 0}
			</div>
			{assign var="open" value=false}
		{/if}
		{if $i % 4 == 0}
			<div class="row justify-content-around">
			{assign var="open" value=true}
		{/if}
		<div class="col-md-3 col-lg-2">
			{include file="frontend/objects/issue_summary.tpl" heading="h2"}
		</div>
	{/foreach}
	{if $open}
		</div>{* Close an open row *}
	{/if}

	{* Pagination *}
	{capture assign="prevUrl"}
		{if $prevPage > 1}
			{url router=$smarty.const.ROUTE_PAGE page="issue" op="archive" path=$prevPage}
		{elseif $prevPage === 1}
			{url router=$smarty.const.ROUTE_PAGE page="issue" op="archive"}
		{/if}
	{/capture}
	{capture assign="nextUrl"}
		{if $nextPage}
			{url router=$smarty.const.ROUTE_PAGE page="issue" op="archive" path=$nextPage}
		{/if}
	{/capture}
	{include
		file="frontend/components/pagination.tpl"
		prevUrl=$prevUrl|trim
		nextUrl=$nextUrl|trim
		showingStart=$showingStart
		showingEnd=$showingEnd
		total=$total
	}
{/if}

{include file=“frontend/components/footer.tpl”}

Please, help me to do group by year!

1 Like

Seconding this proposal. Browsing archives with over 100 issues is not efficient at the moment, because you have to scroll down to the bottom of the page several times.

Grouping by year would be a great core feature for OJS in my opinion. Most major publishing platforms seem to be using an accordion style layout, as mentioned above. I think it’s a reasonable solution. I’ve even seen some who are using several levels, sorting by decade and then year, which would be great for some of our journals who have content going back to the early 1900s, but that is of course a special case.

Most important for us is that the standard behaviour of archive browsing is improved with large quantities of issues in mind.

Best regards,
Magnus A
Lund University Library

Have a look at this example: https://chimia.ch/chimia/issue/archive (308 issues currently). Issues are grouped by year, the last 10 are open, but the remaining can be opened, too.

proposed before:

Hi everyone. I’m copying over the results of some discussions we had several years ago in the dev team. Unfortunately, we have not been able to make progress on this yet.

During the Barcelona sprint, a few of us did some research on this internally and worked together to identify the key use cases we want to serve on the issue archive page. We decided we want to give editors two choices:

  1. Should issues be grouped by year, volume or not at all?
  2. Should issue covers be prominently displayed or not?

These choices could be put into options for the default theme and it can present different issue archive pages depending on each option.

With that in mind we did some preliminary mockups. In this mockup, the issues are grouped by year and volume, and they work like tabs. Clicking on a year “2019 – Volume 2” will show all issues from that year without waiting for a new page load.

side-tabs

In this mockup, the issues are similarly grouped but appear in an accordion display in which the group names appear inline with the issues, and you can toggle the groups open/closed. This provides a more dense display which may work better for journals that have very little issue information and never use cover images.

accordion

These mockups support the most common use case, in which issue cover images are not used or are not a key part of the issue package, either because issue cover images are all similar or because resources are not invested in good-looking covers. In such cases, the issue details can be shown with or without the cover image without having a big impact on the UX, as below.

issue-details

In the mockup below, we show an issue archive page designed to highlight cover images. This would work best in cases where a journal invests significant resources in attractive, distinctive covers. It could work with or without grouping by year or volume.

covers

In the final mockup, we show a browsing pattern specifically for small devices like phones. In such circumstances, we adopt a swiping pattern that is common to mobile devices, in which the user can swipe left/right within the nav area at the top in order to quickly reach old years. And they can swipe left/right within the issue list area to go to the prev/next group (years/volumes).

mobile

From Group archive issues by year (as in OJS2) · Issue #4667 · pkp/pkp-lib · GitHub.

3 Likes

Hi @NateWr . We’d still be happy with the fourth one (the same as in the initial message).

1 Like

Interesting mockups - is a plugin or a website setting planned where the different options are configurable? So publishers could choose what suits them best.

If you are interested in the code for the CHIMIA example above then I can share. It’s just a template / CSS change plus some JavaScript.

On another note: I’m thinking of creating a sidebar block plugin that allows to navigate forward/backwards from issue to issue on the TOC page, and from article to article on the article details page. Unfortunately, I haven’t found the time yet.

1 Like

Hello @Ph_We,

We are trying to make all first “Feature Request” posts follow same structure.We hope this will make it easier to understand the requests and, at the same time, ensure that no relevant information is missing.

Could you please edit your post following this template?

Describe the problem you would like to solve
Example: Our editors need a way to […]

Describe the solution you’d like
Tell us how you would like this problem to be solved.

Who is asking for this feature?
Tell us what kind of users are requesting this feature. Example: Journal Editors, Journal Administrators, Technical Support, Authors, Reviewers, etc.

Additional information
Add any other information or screenshots about the feature request here.

You can use this post as a reference.

Best regards,
m.

Hi @marc! Not sure if there was such template back in 2017 :upside_down_face: Anyway the post is too old, so I do not have permission to edit it now, sorry.

1 Like

:rofl: :rofl: :rofl: :rofl:

What if you create a new FR with the conclusions of this thread and we move the votes from this post to there?