OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



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
What to do if you have a technical problem with OJS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

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.

http://dev.mediaculture.ci.qut.edu.au/ojs/index.php/mcjournal/issue/current/showToc

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:

http://journal.media-culture.org.au/

But by using OJS :lol:

issue-side.tpl:

Code: Select all
<ul>
{if $publishedArticles}
{foreach name=sections from=$publishedArticles item=section }
{foreach from=$section.articles item=article}
   <li>
   <span class="articleTitle"><a href="{url page="article" op="view" path=$article->getBestArticleId($currentJournal)}" class="file">
   {$article->getArticleTitle()|strip_unsafe_html}
   </a></span>
   {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}
   {/if}
   &nbsp;-&nbsp;   
   {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>
   {/foreach}
   </li>
{/foreach}
{/foreach}
{/if}</ul>
chameleon2011
 
Posts: 5
Joined: Thu Mar 16, 2006 10:19 pm
Location: Brisbane, Australia

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.

Regards,
Alec Smecher
Open Journal Systems Team
asmecher
 
Posts: 7710
Joined: Wed Aug 10, 2005 12:56 pm

TemplateManager.inc.php

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:

http://dev.mediaculture.ci.qut.edu.au/ojs/index.php/mcjournal/issue/view/2

No doubt I'll have plenty more questions for you shortly. This should keep me going for a while.
chameleon2011
 
Posts: 5
Joined: Thu Mar 16, 2006 10:19 pm
Location: Brisbane, Australia


Return to OJS Technical Support

Who is online

Users browsing this forum: No registered users and 2 guests