Displaying current issue ToC on all pages

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
The Public Knowledge Project Support Forum is moving to http://forum.pkp.sfu.ca

This forum will be maintained permanently as an archived historical resource, but all new questions should be added to the new forum. Questions will no longer be monitored on this old forum after March 30, 2015.
Posts: 5
Joined: Thu Mar 16, 2006 10:19 pm
Location: Brisbane, Australia

Displaying current issue ToC on all pages

Postby chameleon2011 » Mon Jun 12, 2006 12:12 am

Thought this would be simple, perhaps I just need to add a line to my issue-side.tpl?

I'm hoping to be able to display a modified ToC of the current issue on the sidebar for every page in the journal site.


This will work fine until I browse to a different page within the site. Is there a variable I need to extract/pass to my customized issue.tpl file (called issue-side.tpl) to ensure that ALL pages display the ToC?

On a similar, but related issue, I'd like the title page of an issue to be displayed at the same time as the ToC:


But by using OJS :lol:


Code: Select all

{if $publishedArticles}
{foreach name=sections from=$publishedArticles item=section }
{foreach from=$section.articles item=article}
   <span class="articleTitle"><a href="{url page="article" op="view" path=$article->getBestArticleId($currentJournal)}" class="file">
   {if (!$subscriptionRequired || $article->getAccessStatus() || $subscribedUser || $subscribedDomain)}
      {foreach from=$article->getGalleys() item=galley name=galleyList}
            <a href="{url page="article" op="view" path=$article->getBestArticleId($currentJournal)|to_array:$galley->getGalleyId()}" class="file">{$galley->getLabel()|escape}</a>
   {foreach from=$article->getAuthors() item=author name=authorList}
   <span class="articleAuthor"><a href="{url op="authors" path="view" firstname=$author->getFirstName() middleName=$author->getMiddleName() lastName=$author->getLastName() affiliation=$author->getAffiliation()}">{$author->getFullName()|escape}{if !$smarty.foreach.authorList.last},{/if}</a></span>

Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm

Postby asmecher » Mon Jun 12, 2006 9:31 am

Hello chameleon2011,

In addition to copying the template code to display this, you'll need to make sure that the template variables are properly set (e.g. the $subscriptionRequired variable, among many others) by the PHP code that calls up the template. If you're inserting this code into every journal page in OJS, the best place to insert this code is in classes/template/TemplateManager.inc.php in the display() function. (I'd suggest accomplishing this entire task as a plugin, but given you've started modifying the codebase already, that's a different issue.)

The code responsible for setting up the template variables for displaying an issue is in pages/issue/IssueHandler.inc.php, primarily in the setupIssueTemplate function.

Have you seen the OJS Technical Reference at http://pkp.sfu.ca/ojs/OJSTechnicalReference.pdf? It contains extensive design information for making modifications to OJS.

Alec Smecher
Open Journal Systems Team

Posts: 5
Joined: Thu Mar 16, 2006 10:19 pm
Location: Brisbane, Australia


Postby chameleon2011 » Mon Jun 12, 2006 5:31 pm

Hi Alec,

Thanks for getting back to me so quickly.

Presently, the sidebar template makes a call to the issue-side.tpl file, hence it's attempting to draw it on every page.

The TemplateManager.inc.php display() function looks as though I need to add a variable that extracts the current issue ID number and set it as a global constant, accessible to all templates?

I've been looking through the OJS Reference extensively, and modifying the codebase directly seems to be the best approach given the context of this particular journal.

Your tip regarding modifying the setupIssueTemplate function was particularly handy. Now viewable at:


No doubt I'll have plenty more questions for you shortly. This should keep me going for a while.

Return to “OJS Technical Support”

Who is online

Users browsing this forum: No registered users and 1 guest