How to show current issue with articles on homepage
luchosoto opened this issue · 1 comments
This theme has worked very well, however I need to display the current issue with its related articles, just like the original theme does.
I tried pasting the piece of code from the default indexJournal.tpl into the oldGregg one:
{* Latest issue *}
{if $issue}
<div class="current_issue">
<h2>
{translate key="journal.currentIssue"}
</h2>
<div class="current_issue_title">
{$issue->getIssueIdentification()|strip_unsafe_html}
</div>
{include file="frontend/objects/issue_toc.tpl"}
<a href="{url router=$smarty.const.ROUTE_PAGE page="issue" op="archive"}" class="read_more">
{translate key="journal.viewAllIssues"}
</a>
</div>
{/if}
It shows the issue name, date and description, but fails to show its articles, and throws a PHP error:
PHP Fatal error: Cannot use object of type PublishedArticle as array in /home/revistaestudiosh/public_html/ojs/cache/t_compile/6267f877acd9b945f8a07db7bb24329a969a952a^%%DD^DDF^DDF03D78%%issue_toc.tpl.php on line 87
I also tried using the piece of code from issue.tpl:
{* Display an issue with the Table of Contents *}
{else}
{include file="frontend/components/breadcrumbs_issue.tpl" currentTitle=$issueIdentification}
{/if}
{* Display a message if no current issue exists *}
{if !$issue}
{include file="frontend/components/notification.tpl" type="warning" messageKey="current.noCurrentIssueDesc"}
{* Display an issue with the Table of Contents *}
{else}
{include file="frontend/objects/issue_toc.tpl"}
{/if}
And I get the same results and PHP error as mentioned above.
I also cleared template cache to no avail.
I'm stuck on this one because of my limited PHP knowledge.
Any ideas will be greatly appreciated.
Thank you in advance.
Hi @luchosoto,
In the new concept of Old Gregg the latest articles and most viewed will be shown on the journal's homepage.