Display all the issues on the home page instead of current issue

Dear,

I am trying to display all the issues (Image and title only) on the home page instead of current issues. so I did add the below code to indexJournal.tpl, so I get only one link but not all the archieve, any hints ??

{if !$issues}


{{translate key=“current.noCurrentIssueDesc”}}

{else}

	{* List issues *}
	<div class="issues media-list">
		{iterate from=issues item=issue}
			{include file="frontend/objects/issue_summary.tpl"}
		{/iterate}
	</div>

	{if $issues->getPageCount() > 0}
		<nav class="text-center">
			<ul class="pagination">
				{page_links anchor="issues" name="issues" iterator=$issues}
			</ul>
		</nav>
	{/if}
{/if}

The front page probably does not have the needed data available.
You could check what data the issue handler is sending to the archive template here: https://github.com/pkp/ojs/blob/master/pages/issue/IssueHandler.inc.php#L119

And then follow the instructions here and send that data to the frontpage template: https://pkp.gitbooks.io/pkp-theming-guide/content/en/advanced-custom-data.html

I read the documentation and I know that I need the function archive() to list all the issues, however I don’t know what I should add to indexJournal.tpl to list the issues or how I can call it, I am confusing now.

Can you help regarding that?

You basically need just the contents of the archive() function.

Then you need to add a custom function to you theme plugin with those contents and pass the data to the front page template as instructed in the theming guide.

In the front page template, you need to have similar stucture as in issueArchive.tpl.

I want to display all issues in home and archive page as well. Have you achieved it?

I could not do it based on the recommendation of ajnyga, however, I did some basic coding by adding manually all the links of archives into the home page

I have some coding knowledge as well. May be together we can do it. Please pm your email to further discussion to not bother the community. Once we find solution, we will post it here.

1 Like

@ajnyga @Rania_Azad

I am working on OJS 3.1.2-1

I need to locate the list of all published issues on the cover of the magazine … I have tried to move the code from issueArchive.tpl to indexJournal.tpl but it causes me an error.
Can someone help me by telling me how to do it?

All templates do not have the same variables available. Meaning that when the indexJournal.tpl is loaded, it does not have the list of issues available.

If you want to show the issues on the front page, you need a custom theme. In the themeplugin you then pass the issue data to the template. See an example here: Passing Data to Templates

In your case you just pass the list of issues instead of the announcements. The way the list of issues is passed to the archive is visible here https://github.com/pkp/ojs/blob/master/pages/issue/IssueHandler.inc.php#L122-L155